-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
Build fails with experimental ESM loader #31279
Comments
I've just realized that we can use https://nodejs.org/docs/latest-v12.x/api/worker_threads.html Jest also implements a fallback in case the current environment doesn't support them. |
Maybe a FAQ, I believe it should work as normal if you set |
I depend on ESM packages, this isn't an option for me. However this issue is fixed for me with Node 16.14, so I'm going to close this. |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
What version of Next.js are you using?
12.0.3
What version of Node.js are you using?
16.13.0
What browser are you using?
N/A
What operating system are you using?
macOS
How are you deploying your application?
N/A
Describe the Bug
When using Next.js with Yarn 3's experimental ESM loader enabled, builds will hang for a while and eventually fail. The build process's dependence on jest-worker is causing builds to fail when
--experimental-loader
is passed as a Node runtime argument. There isn't much that Next.js can do to fix this, but I just wanted to bring attention to this issue since PnP users will otherwise have to explicitly opt-out of ESM support starting in Yarn v3.2 and Next.js 12.I've opened an issue on jest-worker tracked here: jestjs/jest#12060
I want to make it clear that this is not a Yarn/PnP bug. This is probably a Node.js quirk with how they've implemented their ESM loader hook.
Expected Behavior
The app should build a starter project without errors with Yarn 3 while PnP is enabled.
To Reproduce
A reproduction repo is available here: https://github.com/kherock/jest-worker-spawn-bug
Please check out the README there for more context.
The text was updated successfully, but these errors were encountered: