edge-runtime: import npm module fail

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

2023-05-01 15:54:13 worker thread panicked Unsupported scheme "npm" for module "npm:ali-oss@6.17.1". Supported schemes: [
2023-05-01 15:54:13     "data",
2023-05-01 15:54:13     "blob",
2023-05-01 15:54:13     "file",
2023-05-01 15:54:13     "http",
2023-05-01 15:54:13     "https",
2023-05-01 15:54:13 ]

To Reproduce

import OSS from "npm:ali-oss@6.17.1";

Expected behavior

import npm module successful

Screenshots

image

System information

  • MacOS
  • Edge
  • supabase-js: 2.21.0
  • Node.js: v18.14.0

Additional context

Add any other context about the problem here.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 12
  • Comments: 17 (2 by maintainers)

Most upvoted comments

Yep, this is currently worked on. I can’t provide an accurate an ETA for it as there are few unknowns at the moment. Will post an update when we have some progress.

@Aadim1 unfortunately that example wouldn’t work in Supabase edge functions yet 😦

@laktek Thanks for the quick reply. Happy to know its in active development. Cheers.

yes, importing npm modules with npm: specifier is now supported in edge-runtime.

Waiting for npm support – for Firebase Cloud Messaging (Notifications) … kinda a big missing thing. 😕

Native npm support would be crucial for supabase edge functions - perhaps any news? @laktek

https://supabase.com/changelog. I can see here that they are using npm:@supabase… to import { createClient } so I am guessing its in the work. Is there any timeline? I can continue developing locally for the time being, if its going to be supported soon.

Meanwhile https://deno.com/blog/npm-on-deno-deploy. I thought that supabase edge runtime is based off deno deploy. Does it mean we can expect supabase to add support soon too?

+1 for npm:<package>@<version> imports.

https://deno.com/blog/npm-on-deno-deploy

@Pictor13 you mean this comment here from @laktek https://github.com/orgs/supabase/discussions/7742#discussioncomment-5375195

NPM support would be such a great thing – it would eliminate a lot of problems with missing dependencies. Should be high priority.

And here the corresponding open issue on denoland https://github.com/denoland/deploy_feedback/issues/314