-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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_MODULE_NOT_FOUND with Yarn 4.6.0 #6646
Comments
@clemyan Could you let me know there is any progress? |
I have dug into this and determined this happens when all of the following is true
If all the the above is true, then the The PnP runtime injects itself into the Node process by monkey-patching the CJS module loader (e.g. The reason this issue does not happen for Yarn 4.5.3 is due to how Jest loads the transformer — it attempts Support for This can be fixed/worked around by:
As far as I can tell, the only way to fix this issue on our side is to revert our support for |
Thanks for the update. I was already wary of Yarn PnP needing to patch Node and TypeScript in order for it to function. I have a workaround to get my Jest example working, but this issue also causes my Storybook build to fail, and I haven't found a trivial workaround for that. It's probably time for me to move off of Yarn PnP, despite it's faster installation times. |
Self-service
Describe the bug
Module resolution fails for some combination of CJS and ESM as of Yarn 4.6.0. It works when using Yarn 4.5.3 or npm (with both Node 22.12.0 and Node 22.11.0).
To reproduce
yarn install
yarn test
Environment
Additional context
No response
The text was updated successfully, but these errors were encountered: