question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

babel-loader version required by StoryBook conflicts with create-react-app version

See original GitHub issue

Describe the bug This is the same issue previously described in https://github.com/storybookjs/storybook/issues/13108 , https://github.com/storybookjs/storybook/issues/11275 and elsewhere. When running yarn test the following errors are displayed:

Manually installing incompatible versions is known to cause hard-to-debug issues.

If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That will permanently disable this message but you might encounter other issues.

To fix the dependency tree, try following the steps below in the exact order:

  1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
  2. Delete node_modules in your project folder.
  3. Remove "babel-loader" from dependencies and/or devDependencies in the package.json file in your project folder.
  4. Run npm install or yarn, depending on the package manager you use.

In most cases, this should be enough to fix the problem.
If this has not helped, there are a few other things you can try:

  5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
     This may help because npm has known issues with package hoisting which may get resolved in future versions.

  6. Check if /Users/jseidel/ppg/hall/winter-spa/node_modules/babel-loader is outside your project directory.
     For example, you might have accidentally installed something in your home folder.

  7. Try running npm ls babel-loader in your project folder.
     This will tell you which other package (apart from the expected react-scripts) installed babel-loader.

If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That would permanently disable this preflight check in case you want to proceed anyway.

P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!

error Command failed with exit code 1.

I have followed all the steps described and it does not resolve the issue. I have also upgraded create-react-app to version 4.0.3.

Running npm ls babel-loader shows the problem:

winter-web-app@0.1.0 /Users/jseidel/ppg/hall/winter-spa
β”œβ”€β”¬ @storybook/addon-essentials@6.2.1
β”‚ └─┬ @storybook/addon-docs@6.2.1
β”‚   └─┬ @storybook/builder-webpack4@6.2.1
β”‚     └── babel-loader@8.2.2  deduped
β”œβ”€β”¬ @storybook/react@6.2.1
β”‚ β”œβ”€β”¬ @storybook/core@6.2.1
β”‚ β”‚ └─┬ @storybook/core-server@6.2.1
β”‚ β”‚   └── babel-loader@8.2.2  deduped
β”‚ └─┬ @storybook/core-common@6.2.1
β”‚   └── babel-loader@8.2.2  deduped
└── babel-loader@8.2.2

Storybook is requiring babel-loader v8.2.2, while create-react-app needs v8.1.0

To Reproduce Steps to reproduce the behavior:

  1. Go to β€˜β€¦β€™
  2. Click on β€˜β€¦β€™
  3. Scroll down to β€˜β€¦β€™
  4. See error

Expected behavior Tests should run without error

Screenshots Error shown above is the problem.

Code snippets If applicable, add code samples to help explain your problem.

System Please paste the results of npx sb@next info here.

Environment Info:

  System:
    OS: macOS 10.15.7
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Binaries:
    Node: 14.12.0 - ~/.nvm/versions/node/v14.12.0/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.14.8 - ~/.nvm/versions/node/v14.12.0/bin/npm
  Browsers:
    Chrome: 89.0.4389.90
    Firefox: 74.0
    Safari: 14.0
  npmPackages:
    @storybook/addon-actions: ^6.1.20 => 6.2.1
    @storybook/addon-contexts: ^5.3.21 => 5.3.21
    @storybook/addon-essentials: ^6.1.20 => 6.2.1
    @storybook/addon-knobs: ^6.1.20 => 6.2.1
    @storybook/addon-links: ^6.1.20 => 6.2.1
    @storybook/addon-storysource: ^6.1.20 => 6.2.1
    @storybook/node-logger: ^6.1.20 => 6.2.1
    @storybook/preset-create-react-app: ^3.1.6 => 3.1.7
    @storybook/react: ^6.1.20 => 6.2.1

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:12
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
sweeetlandcommented, Apr 23, 2021

Yes I have this issue also

2reactions
JESiicommented, Apr 1, 2021

@GDC6203 Already tried that – does not work

Read more comments on GitHub >

github_iconTop Results From Across the Web

babel-loader conflicts with create-react-app version #5183
There is a conflict with babel-loader version. Changing the line in package.json to "babel-loader": "8.0.4" seems to fix it. To Reproduce
Read more >
Yarn Build - Babel-loader issues with Storybook - Stack Overflow
Add the following to your package.json to allow yarn to resolve babel-loader version 8.1.0 (the version required by CRA, not Storybook):
Read more >
babel-loader conflicts with create-react-app version #5183
Describe the bug After creating a new project with create-react-app yarn start and yarn test do not run. There is a conflict with...
Read more >
A dependency conflict between CRA and Storybook
initialized a project using CRA - in my case, I used npx create-react-app myApp - template redux-typescript; installed storybook using npxΒ ...
Read more >
Cannot start React App after installing Storybook? Here's how ...
The react-scripts package provided by Create React App requires a ... However, a different version of babel-loader was detected higher up inΒ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found