You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the unejected version runs babelTransform.js while the ejected version runs babel-jest directly, however babelTransform.js is where we set up the new jsx runtime.
Copying babelTransform.js and updating the "transform" key in package.json fixed this issue.
Describe the bug
Getting "React is not defined" when running tests on react-scripts v4.0.1 after ejecting
Steps to reproduce
Actually I also got #6174 so I needed to remove node_modules and rerun yarn, but this is a different issue.
Analysis
Looking at
create-react-app/packages/react-scripts/scripts/utils/createJestConfig.js
Lines 44 to 46 in 9b08e3c
the unejected version runs babelTransform.js while the ejected version runs babel-jest directly, however babelTransform.js is where we set up the new jsx runtime.
Copying babelTransform.js and updating the "transform" key in package.json fixed this issue.
Alternatively updating package.json from
to
would also fix this issue.
The text was updated successfully, but these errors were encountered: