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

Can't dynamically import an npm module with static analysis off #20479

Closed
tmcw opened this issue Sep 13, 2023 · 1 comment · Fixed by #24107
Closed

Can't dynamically import an npm module with static analysis off #20479

tmcw opened this issue Sep 13, 2023 · 1 comment · Fixed by #24107
Labels
bug Something isn't working correctly node compat

Comments

@tmcw
Copy link

tmcw commented Sep 13, 2023

With the following code:

await import("" + "npm:got");

I get:

➜  git:(v3) ✗ deno run foo.mjs
error: Uncaught (in promise) TypeError: Loading unprepared module: npm:got, imported from: file:///Users/xxx/v/val.town/foo.mjs
await import("" + "npm:got");
^
    at async file:///Users/xxx/v/val.town/foo.mjs:1:1

This works without the "", but if I try to avoid static analysis of the import, it doesn't seem possible to import npm: packages.

@bartlomieju
Copy link
Member

@dsherret please take a look

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

Successfully merging a pull request may close this issue.

3 participants