Skip to content
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

Set allowRemoteModules=false can not prevent load remote npm packages with "npm:" specifier #340

Closed
Code2Life opened this issue May 13, 2024 · 2 comments · Fixed by #341
Closed
Assignees
Labels
bug Something isn't working released

Comments

@Code2Life
Copy link

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

allowRemoteModules=false doesn't work when using npm: specifier

To Reproduce

  1. Create main worker like this:
await EdgeRuntime.userWorkers.create({
      servicePath,
      memoryLimitMb,
      workerTimeoutMs,
      noModuleCache,

      allowRemoteModules: false,
      ...
    });
  1. In user worker, define import
import * as jose from 'npm:jose'

Expected behavior

It should result in
worker boot error failed to load 'npm:something', A remote specifier was requested, but --no-remote is specified.

BUT, it import remote module successfully, while https:// or jsr: prefix works and result in "--no-remote is specified" error

Screenshots

npm specifier still loaded from remote
image

while jsr specifier can result in expected error:
image

Copy link

🎉 This issue has been resolved in version 1.50.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@Code2Life
Copy link
Author

wow, so fast

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
2 participants