-
-
Notifications
You must be signed in to change notification settings - Fork 17
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 require @apollo/server in node20 #10
Comments
ESM are not supported |
|
I found a simple solution to solve this problem, which is to add // package.json
{
"pkg": {
"assets": ["**/package.json"]
}
} The reason is that when Node.js parses files with the Although // @apollo\server\dist\cjs\package.json
{"type":"commonjs"} As a result, it reads I'm not sure why |
Could you track this bug in the code and submit a PR to fix it? Could be an error with the resolver |
@robertsLando I've not contributed to this project in the past but we ran into this issue today and I'd like to do what you suggested and track this down. However, I'm unsure what you're referring to when you say "resolver". |
@davidmwhynot Did you tried with latest pkg version? |
This was also a fix for using tslog https://github.com/fullstack-build/tslog Tried with pkg |
The problem I think is due to We are actually using it in lib/wolker.ts Line 37 in 2fb1e12
I tried to replace it long time ago but without success |
Dup of #16 (comment) |
What version of pkg are you using?
5.11.0
What version of Node.js are you using?
20.10.0
What operating system are you using?
Windows, Ubuntu 22.04
What CPU architecture are you using?
x86_64
What Node versions, OSs and CPU architectures are you building for?
node20-win-x64, node20-linux-x64
Describe the Bug
After
require('@apollo/server')
, an error is thrown when executing the executable created bypkg
. However,node main.js
runs without any errors.Expected Behavior
no errors
To Reproduce
npm install @apollo/server
npx pkg main.js --target node20-win-x64
main.exe
The text was updated successfully, but these errors were encountered: