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

V4.0.26 onwars breaks CJS + pkg builds #1234

Closed
otaviojacobi opened this issue Oct 28, 2024 · 0 comments · Fixed by #1235
Closed

V4.0.26 onwars breaks CJS + pkg builds #1234

otaviojacobi opened this issue Oct 28, 2024 · 0 comments · Fixed by #1235

Comments

@otaviojacobi
Copy link

pkg failure in CJS projects because ESM dependency is added via a is-wsl

Steps to reproduce the behavior:
USe @oclif/core latest (or any >= 4.0.26) will suceed to build with pkg but will not be able to run as the ESM package won't be able to load/resolve with native CJS resulting in:

ERR_MODULE_NOT_FOUND: Cannot find package 'is-wsl' imported from /snapshot/balena-cli/node_modules/@oclif/core/lib/config/config.js
Did you mean to import is-wsl/index.js?

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'is-wsl' imported from /snapshot/balena-cli/node_modules/@oclif/core/lib/config/config.js
Did you mean to import is-wsl/index.js?
    at packageResolve (node:internal/modules/esm/resolve:853:9)
    at moduleResolve (node:internal/modules/esm/resolve:910:20)
    at defaultResolve (node:internal/modules/esm/resolve:1130:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:396:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:365:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38)
    at ModuleLoader.import (node:internal/modules/esm/loader:328:34)
    at importModuleDynamically (node:internal/modules/cjs/loader:1261:33)
    at importModuleDynamicallyWrapper (node:internal/vm/module:431:21)
    at importModuleDynamicallyCallback (node:internal/modules/esm/utils:207:14)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant