D
Deno

help

Using fresh inside an existing deno folder

Ssergees1/27/2024
I have an existing deno project with deno.jsonc at the root and would like to add a web app as a subfolder. When I do this, vscode picks up the settings from the root deno.jsonc (instead of the one generated by fresh cli), so I see a lot of messages like this: “Relative import path "$std/dotenv/load.ts" not prefixed with / or ./ or ../ and not in import map from” What’s the recommended way to do this, i.e. to have multiple deno project inside the same root folder?
Ssergees1/27/2024
I’ve tried to do this: merged the contents of my parent deno.jsonc and from the one in fresh subfolder, also changed the start command as described here: https://fresh.deno.dev/docs/examples/changing-the-src-dir
Changing the source directory | Fresh docs
Change the source directory to effectively manage your project.
Ssergees1/27/2024
Seems to be working with lots of deprecation warnings though (1.40.2)
DAHDeno AI Helper1/27/2024
To have multiple Deno projects within the same root folder, you can utilize the feature of partially enabling Deno in a workspace. This allows you to have a mixed Deno project where some workspace folders are Deno-enabled and some are not. This is particularly useful when you have a project with different components, such as a front-end and a back-end, and you want different configurations for each. Here's what you can do according to the documentation: 1. Create a new workspace or add a folder to an existing workspace: You can organize your project into different folders, each with its own deno.jsonc configuration if needed. 2. Configure the settings for each folder: In the settings, you can configure one of the folders to have deno.enable set to true and one set to false. This will ensure that the Deno language server applies diagnostics only to the enabled folders, while the other folder will use the built-in TypeScript compiler of VSCode to supply diagnostics for TypeScript and JavaScript files. 3. Use the Deno: Enable Paths setting: If you want to enable Deno only for specific sub-paths within a workspace folder, you can use the Deno: Enable Paths setting (or deno.enablePaths if manually editing the settings JSON). This allows you to specify which paths should be Deno-enabled. For your specific case, you can place your web app in a subfolder and enable Deno only for that subfolder. Make sure that the deno.jsonc file in your web app's subfolder is correctly configured for the Fresh framework, and use the Deno: Enable Paths setting to point to your web app's subfolder. Here's an example of how you might structure your project: ``` project/ ├── deno.jsonc (root configuration) ├── some_other_deno_project/ │ └── deno.jsonc
DAHDeno AI Helper1/27/2024
(specific configuration for this sub-project) └── web_app/ ├── deno.jsonc (Fresh configuration) └── ... (other Fresh project files) `` In this structure, you would enable Deno for the web_app/ directory specifically, and ensure that the settings in web_app/deno.jsonc` are respected when working within that directory in VSCode. Remember to check your VSCode workspace settings to ensure that the correct Deno configurations are applied to the respective folders. 🦕
OOoker1/27/2024
In my case, if the path contains a space or a non-ASCII character then it yields this error:
Error: The deployment failed: Relative import path "$fresh/server.ts" not prefixed with / or ./ or ../
Error: The deployment failed: Relative import path "$fresh/server.ts" not prefixed with / or ./ or ../
I haven't figured out how to escape those characters.

Looking for more? Join the community!

Recommended Posts
Remove Dependencies from `deno.lock` fileHello, Somewhere in the code, I did `import postgres from npm:postgres`. This import is the writtenGood scripts/tools to automate conversion of Node.js based projects to Deno?I'm wondering if there are commendations for tools like this? (I found something like this, but it VS Code Extension API development with Deno as a runtime?I'm dipping my toes into [VS Code extension development](https://code.visualstudio.com/api/get-startImporting submodulesHi, I am working for the first time with deno in my supabase edge functions. I am trying to import aVariable references causing lint errors across cells in Deno+JupyterIf you define a variable in one cell and then try to reference it in another cell, you get a "CannotVSCode starting Deno even if enabled=falseII use VSCode in a large project (with several JS packages, none of which use Deno), and after instalUnable to build crate with deno_runtime 0.139.0 or 0.140.0, due to version numbering in deno_astThe two most recently released versions of the deno_runtime crate cannot build at all, due to its buwalk() include only last directory...Hey, I'm currently trying to write a replacer for file names, file content and folder names. My goalHow to link local NPM package with DenoI have a package which has a couple of peer dependencies, which I want to link locally and patch. WhSubhosting API protectionIs there a way to setup custom auth via some header for example for all subhosting routes? I.e. Denolvim tsx language serverafter i clone fresh example in deno deploy, I get an error "Cannot find name 'React' " while openingHow to debug tests in Deno on VSCODEHello everyone, I am trying to debug a unit test in Deno. I have tried using deno test --inspect-brk