-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
deno compile
cannot resolve npm modules
#16632
Comments
As per #15960 it's not yet supported |
Ah, indeed, seems I overlooked that part in the release notes 😅 In any case, congrats and thanks for this release 👍 |
It was a bug that it didn't give you a nice error message explaining this. That will be fixed in #16637. |
Hijacking this because while I'm not having issues compiling, my app doesn't run. deno compile --allow-env --allow-net --allow-read --unstable main.ts
# output
Check file:///~/main.ts
Compile file:///~/main.ts
Emit pastry-server And then ./pastry-server
# output
error: Module not found The error message is not helpful, so I searched the Deno Discord, which led me to this issue. I do have an npm module in my project. import * as packet from "npm:[email protected]"; Guess I'll just keep an eye on this issue and pause that aspect of my project for now. EDIT: I actually fixed my issue. Turns out, |
Hope this issue will be resolved |
+1 for npm support in Deno compile. |
+1 I'm looking forward to this feature. |
+1 looking forward to this feature. |
@dsherret is working on this feature. |
@bartlomieju considering |
@lino-levan no, |
Ah, sorry I misread this issue 😅 |
this one is important for my team working on polyseam/cndi, thanks for looking into this! |
I started actual work on this one yesterday. Just doing the preliminary refactors to make it easier. |
@cb-fred I was a hanging out for this feature until trying out esm.sh for the imports and was glad to see that it compiles. The compile feature being very useful for a project I'm doing. Deno ❤️ |
Okay, need to eat my hat. Want to get @apollo/[email protected] up and running with express. Easy port for my knowledge level. I could write this all out first principals. Can't find apollo server on esm.sh. It's only on npm 😞 . Back to hanging out for this feature. |
@Hillsie same |
+1 looking for this feature! thank you very much guys |
This is the initial support for npm and node specifiers in `deno compile`. The npm packages are included in the binary and read from it via a virtual file system. This also supports the `--node-modules-dir` flag, dependencies specified in a package.json, and npm binary commands (ex. `deno compile --unstable npm:cowsay`) Closes #16632
This is the initial support for npm and node specifiers in `deno compile`. The npm packages are included in the binary and read from it via a virtual file system. This also supports the `--node-modules-dir` flag, dependencies specified in a package.json, and npm binary commands (ex. `deno compile --unstable npm:cowsay`) Closes #16632
It seems that
deno compile
has trouble compiling scripts using npm modules.Given the following script:
When I do
I get the following error:
I use the following deno version:
On OSX version 12.6
Using
deno run
on the same script works, as doesdeno compile
for scripts that do not use npm packages.The error also happens when using npm packages other than express
The text was updated successfully, but these errors were encountered: