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.

Can't use storybook ^2.0.0 when babel-loader is defined in preLoaders

See original GitHub issue

Hi!

My webpack configuration is something like this:

{
  entry: {...},
  output: {...},
  module: {
    noParse: [/moment.js/],
    loaders: [
      { test: /\.json$/, loaders: ['json'] },
      { test: /\.scss$/, loaders: [ 'style', 'css', 'postcss', 'sass' ] },
      { test: /\.css$/, loaders: [ 'style', 'css?-minimize', 'postcss' ] },
      { test: /\.(ttf|eot|otf)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loaders: [ 'file?name=[name].[ext]' ] },
      { test: /\.svg$/, loaders: [ 'file?name=[name].[ext]', 'svg-process' ] },
    ],
    preLoaders: [
      {
        test: /\.js$/,
        loader: 'rebem-layers',
        exclude: /node_modules/,
      },
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: 'babel-loader',
        query: {
          cacheDirectory: true,
          env: {
            development: {
              presets: [ 'react-hmre' ],
            },
          },
        },
      },
      {
        test: /\.js$/,
        loader: 'eslint-loader',
        exclude: /node_modules/,
      },
    ],
  },

The problem is as I see is, that storybook 2.0.0 defines the new default webpack config. There a default babel-loader is probably defined, and my configuration is not overriding that. I am assuming this also from the fact, that running storybook is now very slow and it shows that babel is trying to transpile everything from node_modules (which is excluded in my configuration).

Reverting to storybook 1.41.0 version was my temporary solution.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
PTihomircommented, Aug 5, 2016

Sorry about the wrong path 😃 I was checking if some of the stories affect the whole picture, and after that I forgot to revert.

I will try the newer version on our full project.

0reactions
arunodacommented, Aug 5, 2016

Great. Awesome.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't run Storybook with Webpack@5 · Issue #15252
Describe the bug When trying to use Storybook in a project that uses webpack@5, and it's not installed as a direct dependency, but...
Read more >
Storybook ERROR. Module not found: Error: Can't resolve ' ...
I tried to configure a .storybook/webpack.config.js but it still doesn't work, I can't find the key to resolve this error. I'm using node...
Read more >
TypeScript
Storybook is a frontend workshop for building UI components and pages in isolation. Thousands of teams use it for UI development, testing, and...
Read more >
@storybook/addon-jest | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
Migrating Versions - webpack 3 documentation
This style is only supported using the legacy option module.loaders . ... Code like this should be refactored as it won't work with...
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