Skip to content
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

After ejecting, testing fails #6174

Closed
eliranbenishai opened this issue Jan 11, 2019 · 4 comments
Closed

After ejecting, testing fails #6174

eliranbenishai opened this issue Jan 11, 2019 · 4 comments

Comments

@eliranbenishai
Copy link

eliranbenishai commented Jan 11, 2019

Is this a bug report?

Yes.

Did you try recovering your dependencies?

Yes.

Environment

System:
OS: Windows 10
CPU: x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
Binaries:
Yarn: 1.13.0
npm: 6.2.0

Steps to Reproduce

  1. create-react-app testing
  2. npm run eject
  3. npm test
  4. Observe spectacular failure

Expected Behavior

Test should pass just as it did before ejecting.

Actual Behavior

FAIL src/App.test.js ● Test suite failed to run

[BABEL] C:\code\testing\src\App.test.js: Cannot find module '@babel/plugin-transform-react-jsx' (While processing: "C:\\code\\testing\\node_modules\\babel-preset-react-app\\index.js$1")

  at _pluginTransformReactJsx (node_modules/babel-preset-react-app/node_modules/@babel/preset-react/lib/index.js:19:39)
  at _default (node_modules/babel-preset-react-app/node_modules/@babel/preset-react/lib/index.js:73:16)
  at node_modules/@babel/helper-plugin-utils/lib/index.js:19:12
  at loadDescriptor (node_modules/@babel/core/lib/config/full.js:165:14)
  at cachedFunction (node_modules/@babel/core/lib/config/caching.js:33:19)
  at loadPresetDescriptor (node_modules/@babel/core/lib/config/full.js:235:63)

Test Suites: 1 failed, 1 total Tests: 0 total Snapshots: 0 total Time: 1.954s

Help?

@saranshkataria
Copy link
Contributor

Followed the steps mentioned on a Windows 10 machine, but I am not getting the test suite failed.

Test Suites: 1 passed, 1 total

@feugy
Copy link

feugy commented Jan 23, 2019

If you eject from a clean installation, you'll have the same.

npx create-react-app my-app
cd my-app
yarn
yarn eject 
yarn test

It's because that dependency is not written in package.json when ejecting.

@mrlubos
Copy link

mrlubos commented Feb 19, 2019

Doesn’t npm i -D @babel/plugin-transform-react-jsx solve this error?

@iansu
Copy link
Contributor

iansu commented Jun 30, 2021

Can you try the latest release and see if this has improved? If not please open a new issue.

@iansu iansu closed this as completed Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants