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.

Incompatibility with "babel-core": "^7.0.0-beta.2"

See original GitHub issue

Hello!

The issue I am running across pertains to a mismatch between the babel-core version my project is using, and the babel-preset-react version @storybook/react is using.

As the issue title says, the babel-core dependency in my project is ^7.0.0-beta.2.

The project is using @storybook/react version ^3.2.12.

After running with yarn run storybook, and pulling up Storybook in my browser, I’m seeing the following:

ERROR in ./.storybook/config.js
Module build failed: Error: [BABEL]... /node_modules/@storybook/react/node_modules/babel-preset-react/lib/index.js.env is not supported in a preset

I understand that this is due to a mismatch between the version of babel-core in my project (^7.0.0-beta.2), and the version of babel-preset-react (^6.24.1) in the @storybook/react project.

Is there a version of Storybook I can use to resolve this issue, or any custom configuration I can provide to ensure that Storybook runs with using "babel-preset-react": "^7.0.0-beta.2"?

Thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
MrSaintscommented, Dec 6, 2017

To get around this, I decided to override the default Webpack config rules using the method described here: https://storybook.js.org/configurations/custom-webpack-config/. I can run storybook with Babel 7 now.

Example:

const genDefaultConfig = require("@storybook/react/dist/server/config/defaults/webpack.config.js");
const myConfig = require("../webpack.config.js");

module.exports = (baseConfig, env) => {
    const config = genDefaultConfig(baseConfig, env);
    config.module.rules = myConfig.module.rules;
    return config;
};
3reactions
Hypnosphicommented, Jan 10, 2018

Should be fixed with #2494

Read more comments on GitHub >

github_iconTop Results From Across the Web

Incompatibility with "babel-core": "^7.0.0-beta.2" #2062
Hello! The issue I am running across pertains to a mismatch between the babel-core version my project is using, and the babel-preset-react ...
Read more >
Requires Babel "7.0.0-0" but was loaded with "6.26.3"
Error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3". If you are sure you have a compatible version of @babel/core, ...
Read more >
Babel 7 Released
Babel 7 is a huge release: we've made it faster, created an upgrade tool, JS configs, config "overrides", more options for size/minification, ...
Read more >
babel-loader@7.1.2 versions and peer dependencies
Online Peer dependency version tool to search for compatible versions of related NPM packages.
Read more >
Nodejs build - out of memory
Hey when I'm deploying my app I keep getting an out of memory error? May 14 02:28:54 PM ==> Detected Node version 12.22.1...
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