Skip to content

After ejecting, testing fails #6174

Closed
Closed

Description

@eliranbenishai

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?

Activity

  1. saranshkataria commented on Jan 11, 2019

    @saranshkataria
    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

  2. feugy commented on Jan 23, 2019

    @feugy

    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.

  3. mrlubos commented on Feb 19, 2019

    @mrlubos

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

  4. self-assigned this
    on Mar 7, 2019
  5. modified the milestones: 2.1.x, 3.x on Mar 7, 2019
  6. iansu commented on Jun 30, 2021

    @iansu
    Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions