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

[Bug?]: ERR_REQUIRE_ESM in Yarn PnP mode using Node.js 22 with --experimental-require-module flag #6336

Open
1 task
NMinhNguyen opened this issue Jun 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@NMinhNguyen
Copy link

NMinhNguyen commented Jun 12, 2024

Self-service

  • I'd be willing to implement a fix

Describe the bug

ERR_REQUIRE_ESM when requiring an ES module from CommonJS using Yarn PnP with Node.js 22 with --experimental-require-module flag.

To reproduce

https://codesandbox.io/p/devbox/nervous-leavitt-ndnn53

yarn start

Environment

System:
  OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
  CPU: (2) X64 AMD EPYC
Binaries:
  Node: 22.3.0 - / tmp/xfs-d3661e12/node
  Yarn: 4.3.0 - /tmp/xfs-d3661e12/yarn
  npm: 10.8.1 - /usr/local/share/nvm/versions/node/v22.3.0/bin/npm
  pnpm: 8.15.6 - /usr/local/share/npm-global/bin/pnpm

Additional context

Would expect this to work, thanks to nodejs/node#51977.

Disabling Yarn PnP works: https://codesandbox.io/p/devbox/nervous-leavitt-forked-9mgdvt

@NMinhNguyen NMinhNguyen added the bug Something isn't working label Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant