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-developmentLocal development | Supabase Docs
Setup local development environment for Edge Functions.
12 Replies
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.
this is the workspace file
this is the output of Deno Language Server Status
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.
then if i change the workspace configuration
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.
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
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
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.
well, if it's still not fixed you might wanna file an issue on GitHub
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...
I’ll give it a watch, then if the issue is still there, I’ll log a ticket
@SB hey there, I'm having a similar situation, did you ever found a solution?