yao-pkg / pkg

Package your Node.js project into an executable
https://www.npmjs.com/package/@yao-pkg/pkg
MIT License
312 stars 11 forks source link

v5.11.2 creates broken builds #28

Closed Mikescops closed 6 months ago

Mikescops commented 6 months ago

What version of pkg are you using?

5.11.2

What version of Node.js are you using?

18.19.0

What operating system are you using?

macOS

What CPU architecture are you using?

Apple M1/2/3

What Node versions, OSs and CPU architectures are you building for?

node-18-macos-arm64

Describe the Bug

Since the update to 5.11.2 the builds give the following error when executed:

node:internal/bootstrap/realm:420
  if (!mod) throw new TypeError(`Missing internal module '${id}'`);
            ^

TypeError: Missing internal module 'internal/modules/cjs/helpers'
    at requireBuiltin (node:internal/bootstrap/realm:420:19)
    at pkg/prelude/bootstrap.js:1884:12
    at pkg/prelude/bootstrap.js:1986:3
    at pkg/prelude/bootstrap.js:2259:3
    at readPrelude (node:internal/bootstrap/pkg:36:12)
    at node:internal/bootstrap/pkg:41:18
    at node:internal/bootstrap/pkg:48:4
    at node:internal/bootstrap/pkg:49:2

Node.js v18.19.0

Also the CI here for the latest do not pass the yarn test.

Expected Behavior

Builds should work.

CI should pass tests.

To Reproduce

Bundle code with the version 5.11.2.

Mikescops commented 6 months ago

@robertsLando thanks for your work here btw.

Link to the reported issue on our builds: https://github.com/Dashlane/dashlane-cli/issues/211

LInk to the failed CI: https://github.com/yao-pkg/pkg/actions/runs/7797115337/job/21263105246

timokoessler commented 6 months ago

I get the same error when I create binaries for Windows or Linux on my Windows device with Node.js v20 that target node-18-*. If I use node-20-* as the target, the problem does not occur.

robertsLando commented 6 months ago

There must be something wrong with nodejs 18.19 patches, could someone check them? I will give it a look on Monday

robertsLando commented 6 months ago

Ok found the issue, release is coming

robertsLando commented 6 months ago

Try 5.11.3 and let me know

Mikescops commented 6 months ago

Works for me! Thanks 🎉

paulish commented 6 months ago

Now it does not work with node:18-alpine docker

robertsLando commented 6 months ago

@paulish PKG Version and error?

paulish commented 6 months ago

@robertsLando seems that the problem appeared in earlier version. I described it in a separate issue.

robertsLando commented 6 months ago

I have a feel your problem isn't related to this issue BTW, it's something else