-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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 process a file inside node_modules
, giving error Cannot use import statement outside a module
#36077
Comments
Same with using |
For now I went with - module.exports = createJestConfig(customJestConfig);
+ module.exports = async () => ({
+ ...await createJestConfig(customJestConfig)(),
+ transformIgnorePatterns: [
+ 'node_modules/(?!(monaco-editor)/)',
+ '^.+\\.module\\.(css|sass|scss)$',
+ ]
}); Should work for @msafi as workaround for now, just replace
|
|
THIS helped me so much I thought I am going insane! thanks for finding the bug and temp solution |
@msafi Had the same happen to me when I forgot the Also, only |
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. |
Verify canary release
Provide environment information
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
I'm using the module
remark
in one of my components that I need to test. But when I run the test for that component with Jest. I see the following errorMy
jest.config.js
is the followingExpected Behavior
I expect
next/jest
to handle this situation?To Reproduce
Follow the recommended steps to setup a Next.js project with Jest support, then build a component that uses the
remark
module and write a test for it.The text was updated successfully, but these errors were encountered: