-
-
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
Private npm packages cannot be imported in edge functions: npm package '@org/package' does not exist.
#402
Comments
@nyannyacha this issue is unrelated to self hosting, as far as I know - I have only experienced it in local development, but we plan on hosting with Supabase, does the self-hosted tag imply that it won't be a problem in production (still a pain to develop if so, but better than nothing). |
Hello @elyobo The private registry you are requesting is a feature that was already introduced in Deno 1.44, as you may already know. We recently versioned the Deno code base of the edge runtime to 1.45.x, and there is some work that needs to be done on the edge runtime side to get this feature. Functions on the Supabase Hosted can be defined as passing a bundle command to the edge runtime running inside Docker via the cli to generate an eszip binary, which is then uploaded. This is a feature that needs to be implemented within the edge runtime repository, not privately in the Supabase Hosted domain, because the private registry will be referenced during the eszip bundling process. That's why I've tagged it self-hosted. Also, just because Deno, the upstream has version up, doesn't mean that edge runtime will support the latest features right away, we are version up the codebase over a period of time. There are a few things I'm currently working on, so I'm not sure when I'll be able to bring this feature to you. But I'll let you know if there are any updates. Have a good day! |
Thanks @nyannyacha, that all makes sense! As noted in the original issue, I am aware that the Deno support was recent so wasn't sure to record this as a bug or a feature request 😅 Great to know it's in the works though! I've worked around the requirement for the moment by copying in the required code instead but will be happy to replace that kludge once private package support lands. |
🎉 This issue has been resolved in version 1.59.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Bug report
Not clear if this is a bug report or feature request;
deno
has added this functionality but I don't understand the implications for the edge runtime and whether this support indeno
means it should automatically be supported or not.Describe the bug
Deno now supports private registries, but
supabase
's localsupabase functions serve
does not seem to.I have a private package in my
package.json
, my editor is happy with the import, and I can run it directly withDeno
usingdeno run --allow-net supabase/functions/auth/index.ts
but when running viasupabase functions serve
and invoking viacurl
I receive output like the followingTo Reproduce
package.json
, e.g.npm i @org/package
where@org/package
is a private package that you have access to; this may require you to configure your~/.npmrc
appropriately e.g. as described in thedeno
docs.supabase functions serve
curl
Expected behavior
The private npm package should be imported.
Screenshots
N/A
System information
Additional context
deno
added support recently in denoland/deno#16105; when running the function code directly indeno
I tested with these versionsI've also tried shifting the relevant
.npmrc
which configures the private registry and access token around from~/
tosupabase
andsupabase/functions
but with no change in results.The text was updated successfully, but these errors were encountered: