-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
supabase serve uses "--no-npm" mode for Deno. Why? This breaks code that needs npm modules. #211
Comments
For additional context -- I need to use npm resolutions in Deno because there are some modules (like |
Thank you for clarifying your use case. I've pinged our functions team to help take a look. |
@evelant Deno Deploy, the hosting platform we use for functions doesn't support npm specifiers yet. To keep dev/prod parity we disable the npm resolution when serving functions locally. We will update the docs to mention this limitation. |
@laktek OK thanks. I managed to work around the limitation with a bit of struggle. I'm running into another issue as well -- globals that should be defined are undefined in the edge runtime (at least locally with |
@laktek according to the deno deploy docs I want to investigate further but I don't see the Dockerfile for the edge runtime available anywhere. Is it not released on github? |
@sweatybridge @laktek I've looked everywhere and I haven't been able to find source for |
@evelant we will be open-sourcing
|
@laktek Can you provide any more information about what is/isn't available in the edge-runtime? The docs are pretty sparse at the moment. |
@laktek I'm seeing a crash when cleaning up my db connection, |
@evelant Yep, looks like BTW, you can check what's available in edge-runtime's global scope by adding |
@laktek Any timeline on when npm specifiers might get supported in the edge runtime? I'm still stuck without any type checking in editor for edge functions because of multiple bugs with vscode_deno (see supabase/cli#1303 (comment)). Working with edge functions is so painful because of Deno. Npm support might help alleviate that since esm.sh doesn't work well with a lot of packages. |
I would also love for npm support. |
Deno deploy supports npm packages since september 👀 |
edge-runtime now supports npm modules https://supabase.com/blog/edge-functions-node-npm |
Bug report
Describe the bug
I ported my firebase functions to supabase edge functions. In doing so I had to use some npm modules, which I thought was fine since deno supports npm. Upon trying to run my code however I was suprised to be hit with
The supabase cli passes "--no-npm" when invoking Deno.
Code is here https://github.com/supabase/cli/blob/a30210717bdb1f3c9d3d5ce940d000971fc1a6da/internal/functions/serve/serve.go#L190
As far as I can tell this isn't documented anywhere by Supabase resulting in a surprise for users. Since Supabase targets people who want to switch from Firebase this is likely to affect almost everyone who attempts to switch as most people use npm modules in their firebase functions.
To Reproduce
"@effect/io/": "npm:/@effect/[email protected]/",
supabase functions serve
--no-npm
option passed to Deno by supabase cli.Expected behavior
All Deno features should work. If there's a specific reason why
--no-npm
is needed it should be clearly documented along with an explanation of how to work around being unable to use npm import specifiers.Screenshots
N/A
System information
Additional context
The text was updated successfully, but these errors were encountered: