Open pago opened 1 year ago
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.
import {anyPass} from 'ramda'
to
import R from 'ramda'
and used it where required as
R.anyPass(...)
and the tests started to work fine.
I have the same issue. Next v13.4.12
You have to add ramda
package to transpilePackages
in the next config.
You have to add
ramda
package totranspilePackages
in the next config.
This is the best solution to any package causing such problem.
Confirmed issue still present in Next v13.5.4.
I confirmed adding ramda
package to transpilePackages
in the next config worked. This is the best answer.
Verify canary release
Provide environment information
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 https://github.com/vercel/next.js/pull/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