-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Jest fails to import ramda #52541
Comments
I can confirm the bug exists in the newest release - "13.4.10". |
Any word on working to fix this and confirming it is still here in "13.4.12" |
Had the same problem. I replaced the import from e.g. and the tests started to work fine. |
I have the same issue. Next v13.4.12 |
You have to add |
This is the best solution to any package causing such problem. |
Confirmed issue still present in Next v13.5.4. |
I confirmed adding |
Verify canary release
Provide environment information
➜ workspace git:(master) ✗ npx next info Operating System: Platform: linux Arch: x64 Version: #22 SMP Tue Jan 10 18:39:00 UTC 2023 Binaries: Node: 16.17.0 npm: 8.15.0 Yarn: 1.22.19 pnpm: 7.1.0 Relevant Packages: next: 13.4.10-canary.3 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0 typescript: 4.9.4 Next.js Config: output: N/A
Which area(s) of Next.js are affected? (leave empty if unsure)
Jest (next/jest)
Link to the code that reproduces this issue or a replay of the bug
https://codesandbox.io/p/sandbox/github/vercel/next.js/tree/canary/examples/reproduction-template?file=%2Fpackage.json%3A1%2C1
To Reproduce
Run
npm test
in the consoleDescribe the Bug
When importing
ramda
in a test or from a file under test, the import fails due to attempting to loadramda/es/[filename].js
. Jest is unable to process the ES Module syntax used within theramda/es
directory.This issue is a regression, most likely introduced through #50900 by @timneutkens
The
modularizeImports
configuration option specified there seems to be passed through to the SWC plugin innext/jest
. However, SWC is also configured to ignorenode_modules
during processing, therefore the test fails.Expected Behavior
The test should be exected correctly.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
NEXT-1429
The text was updated successfully, but these errors were encountered: