SB
SB5mo ago

Mono Repo - Enable Paths

I tried to follow the guide below to use enable paths but VSCode keeps giving the following error Cannot find name 'Deno'.ts(2304) Any help please? https://docs-qx6wony0a-supabase.vercel.app/docs/guides/functions/local-development
Local development | Supabase Docs
Setup local development environment for Edge Functions.
No description
12 Replies
CatalinIuga
CatalinIuga5mo ago
Checklist: - installed Deno? - installed Deno VS code extension? - correct path specified in settings.json? You could also enable Deno for the whole workspace using Ctrl + Shift + P > Deno: Enable and see if that works first hand.
SB
SBOP5mo ago
vscode ➜ /workspaces/backend (feat/sunsynk-support) $ deno --version
deno 1.45.0 (release, aarch64-unknown-linux-gnu)
v8 12.7.224.12
typescript 5.5.2
vscode ➜ /workspaces/backend (feat/sunsynk-support) $ deno --version
deno 1.45.0 (release, aarch64-unknown-linux-gnu)
v8 12.7.224.12
typescript 5.5.2
this is the workspace file
{
"folders": [
{
"name": "project-root",
"path": "./"
},
{
"name": "supabase",
"path": "supabase"
},
{
"name": "supabase-functions",
"path": "supabase/functions"
},
{
"name": "automation",
"path": "automation"
},
{
"name": "infrastructure",
"path": "infrastructure"
},
{
"name": "utils",
"path": "utils"
}
],
"settings": {
"files.exclude": {
"supabase": true,
"functions": true,
"automation": true,
"infrastructure": true,
"utils": true
},
//"deno.enable": false,
//"deno.enablePaths": ["supabase-functions"],
//"deno.importMap": "./supabase/functions/import_map.json"
}
}
{
"folders": [
{
"name": "project-root",
"path": "./"
},
{
"name": "supabase",
"path": "supabase"
},
{
"name": "supabase-functions",
"path": "supabase/functions"
},
{
"name": "automation",
"path": "automation"
},
{
"name": "infrastructure",
"path": "infrastructure"
},
{
"name": "utils",
"path": "utils"
}
],
"settings": {
"files.exclude": {
"supabase": true,
"functions": true,
"automation": true,
"infrastructure": true,
"utils": true
},
//"deno.enable": false,
//"deno.enablePaths": ["supabase-functions"],
//"deno.importMap": "./supabase/functions/import_map.json"
}
}
No description
SB
SBOP5mo ago
this is the output of Deno Language Server Status
SB
SBOP5mo ago
Starting Deno language server... version: 1.45.0 (release, aarch64-unknown-linux-gnu) executable: /usr/local/bin/deno Connected to "Visual Studio Code" 1.91.0 Enabling import suggestions for: https://deno.land Refreshing configuration tree... Resolved package.json: "/workspaces/backend/package.json" Could not set npm package requirements: Error getting response at https://registry.npmjs.org/@types/node for package "@types/node": An npm specifier not found in cache: "@types/node", --cached-only is specified. Could not set npm package requirements: Error getting response at https://registry.npmjs.org/@types/node for package "@types/node": An npm specifier not found in cache: "@types/node", --cached-only is specified. Server ready.
Deno
Deno, the next-generation JavaScript runtime
Deno features improved security, performance, and developer experience compared to its predecessor. It's a great time to upgrade your Node.js project to run on Deno.
SB
SBOP5mo ago
then if i change the workspace configuration
{
...
],
"settings": {
"files.exclude": {
"supabase": true,
"functions": true,
"automation": true,
"infrastructure": true,
"utils": true
},
//"deno.enable": false,
"deno.enablePaths": ["supabase-functions"],
"deno.importMap": "./supabase/functions/import_map.json"
}
}
{
...
],
"settings": {
"files.exclude": {
"supabase": true,
"functions": true,
"automation": true,
"infrastructure": true,
"utils": true
},
//"deno.enable": false,
"deno.enablePaths": ["supabase-functions"],
"deno.importMap": "./supabase/functions/import_map.json"
}
}
Enabling import suggestions for: https://deno.land Refreshing configuration tree... Resolved package.json: "/workspaces/backend/package.json" Resolved import map: "file:///workspaces/backend/supabase/functions/import_map.json" Starting Deno language server... version: 1.45.0 (release, aarch64-unknown-linux-gnu) executable: /usr/local/bin/deno Connected to "Visual Studio Code" 1.91.0 Enabling import suggestions for: https://deno.land Refreshing configuration tree... Resolved package.json: "/workspaces/backend/package.json" Resolved import map: "file:///workspaces/backend/supabase/functions/import_map.json" Server ready. { "enable": true, "disablePaths": [], "enablePaths": [ "supabase-functions" ], "cache": null, "cacheOnSave": true, "certificateStores": null, "config": null, "importMap": "./supabase/functions/import_map.json", "codeLens": { "implementations": false, "references": false, "referencesAllFunctions": false, "test": false }, ....
Deno
Deno, the next-generation JavaScript runtime
Deno features improved security, performance, and developer experience compared to its predecessor. It's a great time to upgrade your Node.js project to run on Deno.
SB
SBOP5mo ago
if it helps, i get this message vscode ➜ /workspaces/backend/supabase/functions (feat/sunsynk-support) $ deno test --allow-net --allow-read --allow-env --import-map=./import_map.json ./test/* error: Specifying an import map in a workspace via CLI flags is not implemented. removing the package.json from the root of the mono repo, and this command works
CatalinIuga
CatalinIuga5mo ago
Might be related to mono repo support that was just introduced just introduced in 1.45.0. I believe there's still some issues that need addressing. I belive ryan also mentioned the team is working on a fix for 1.45.1
SB
SBOP5mo ago
do you have a link, maybe i can help with testing? Hi @CatalinIuga is this fixed now? I have installed 1.45.2 and still have the issue.
CatalinIuga
CatalinIuga5mo ago
well, if it's still not fixed you might wanna file an issue on GitHub
CatalinIuga
CatalinIuga5mo ago
there's also a stream about monorepos using Deno 2morow if you are interested: https://www.youtube.com/live/OMJKEDvsT7Q?si=id7tc_EeJIXv_K-B
Deno
YouTube
Monorepos and workspaces in Deno
With 1.45, Deno now supports workspaces. Join our livestream where we go over Deno's new workspaces support, demo how you can use it, and show how to use Den...
SB
SBOP5mo ago
I’ll give it a watch, then if the issue is still there, I’ll log a ticket
Marko Kolombo
Marko Kolombo3mo ago
@SB hey there, I'm having a similar situation, did you ever found a solution?