-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
2.1.4 Update cause "Cannot find module '/Users/.../node_modules/react-scripts/node_modules/@babel/runtime/helpers/interopRequireDefault' from 'setupTests.ts'" #6398
Comments
I have to manually add |
I have the same issue with the module babel-preset-react-app since I updated to [email protected] the module babel-preset-react-app doesn't have a
|
I was able to work around this issue with:
The latest version as of this writing is Relevant commits: FYI @ianschmitz. I'm not sure if this is related to your work, but your name popped up. |
I had a workaround where I told yarn not to hoist |
@bugzpodder Do you know if there is a comparable solution for npm users? |
Sorry I only use yarn on this project because of workspaces. I tried a fresh install of create-react-app but didn't run into this issue. |
@bugzpodder understood. I also can't repro this on a fresh CRA install. I think this issue may be related to the testing toolchain, as my error output looks very similar to @VincentLanglet's:
|
I tried to make a minimal repo with this bug. But I really don't understand what happend.
Produce the error
Still the error
No error (WHAT THE F$$$)
Still the error
No error |
@bugzpodder How do you do this ? |
Adding |
I was getting the error after the update due to the moduleNameMapper argument in my test script.
Once I removed moduleNameMapper, all my tests ran successfully (execpt for the ones using match-sorter mock) |
For me error gone after doing |
Hi all, I've had this report from some colleagues too. I'm not sure what's causing it, we're looking into it. |
This worked for us on our debian machine! |
To be clear, is this affecting npm and Yarn users? I understand you're on npm, @jeremyckahn? |
From our side, we are on npm |
@mrmckeb I'm using |
OK, one more question - is everyone here using When I remove Can anyone else confirm this? If this is not the case, can you please run the below and post the results here? npm ls babel-preset-react-app |
I'm not using @storybook/react. I had 7.0.1. Downgraded to 7.0.0 and problem goes away.
… 13 feb. 2019 kl. 21:01 skrev Brody McKee ***@***.***>:
OK, one more question - is everyone here using @storybook/react? It looks like it might be because that package has a dependency on "babel-preset-react-app": "^6.1.0".
When I remove @storybook/react, the problem goes away. When I add it back, but use Yarn resolutions to force "babel-preset-react-app": "7.0.1", the problem is also gone.
Can anyone else confirm this?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@tregusti, can you run |
FYI, I don't know how but it works now and
Seems like something wrong between dependencies and |
I returned my project to the state it was when this issue was happening yesterday, removed My output for
My project is not using |
@mrmckeb I only have one copy fo babel-preset-react-app => Found "[email protected]"
Downgrading to [email protected] helps, but only because in node_modules/babel-preset-react-app/node_modules/@babel/runtime exists. Removing the node_modules inside babel-preset-react-app causes the same error. Alternatively adding |
Hi, I got the same issue today when upgrading React-Testing-Library (not sure if that has anything to do with it). Not using storybook. Heres my output from |
@Ciaran0 this is unrelated, please try [email protected] to resolve. |
We're still actively investigating this, and trying to get a fix out as soon as possible. Hopefully everyone has been able to use the workarounds posted above in the meantime. |
For me, upgrading to 2.1.8 did not help.
Hope this helps. |
This worked for me not sure why |
I had the same issue, fixed it by and it worked after that. |
ran into this after installing node-sass using npm i deleted node_modules and then did a yarn install and issue was resolved. seems this is related to using npm. |
Thank you! |
worked for me |
God bless ya! Works! Nevertheless, the problem still exists in One note, when I run tests through cli, then they run properly. The problem occurred only when I run the tests through IntelliJ. Thanks. |
Thanks! It worked for me
|
I'm seeing a similar error with [email protected]. Every Jest test fails to import Adapter from 'enzyme-adapter-react-16':
Installing [email protected] as suggested above fixes the issue and all tests can run fine. |
This worked for me. Delete node_modules and running |
I ran `npm audit fix`. Then the tests failed. So I had to do `npm i [email protected]` based on [this issue](facebook/create-react-app#6398).
The problems shows up after upgrading react scripts to version 3.3.1 |
I hade the same issue but I'm not using yarn. So I did |
Thanks, this worked for me after an upgrade from node 10.x to 12.x. In my case, it was |
We are no longer seeing this issue after upgrading to [email protected] and removing [email protected] from devDependencies. |
I incurred the same issue lateron I realized that yarn.lock is the main culprit. |
Thank you so much, it worked for me ! |
Environment
Steps to Reproduce
Starting from my project with
react-scripts: 2.1.3
,yarn
yarn test
workingyarn add [email protected]
yarn test
workingyarn-deduplicate
what is thisIntroducing these modifications in the
yarn.lock
yarn
yarn test
not working anymoreIf needed I'll try to make a reproductible demo. My actual project is for work (and not open-source...).
The text was updated successfully, but these errors were encountered: