storybookjs / addon-styling-webpack

Successor to @storybook/addon-styling. Configure the styles of your webpack storybook with ease!
MIT License
27 stars 3 forks source link

[Bug] Installing on an existing 7.6.17 causes storybook to crash -- can't find module node-logger #22

Open seamus-sc opened 1 month ago

seamus-sc commented 1 month ago

Describe the bug

When trying to install Tailwind/Postcss on my existing Storybook 7.6.17 project, adding the '@storybook/addon-styling-webpack' add on causes storybook to crash with message:

Error: Cannot find module 'storybook/internal/node-logger'

Steps to reproduce the behavior

  1. Start with an existing 7.6.17 project with React/Webpack5
  2. npx storybook@7.6.17 add @storybook/addon-styling-webpack
  3. Y to install missing dependencies (style-loader, css-loader, postcss-loader)
  4. npm run storybook
  5. Error:
    
    SB_CORE-SERVER_0002 (CriticalPresetLoadError): Storybook failed to load the following preset: ./.storybook/main.js.

Please check whether your setup is correct, the Storybook dependencies (and their peer dependencies) are installed correctly and there are no package version clashes.

If you believe this is a bug, please open an issue on Github.

SB_CORE-SERVER_0002 (CriticalPresetLoadError): Storybook failed to load the following preset: ./node_modules/@storybook/addon-styling-webpack/dist/preset.js.

Please check whether your setup is correct, the Storybook dependencies (and their peer dependencies) are installed correctly and there are no package version clashes.

If you believe this is a bug, please open an issue on Github.

Error: Cannot find module 'storybook/internal/node-logger' Require stack:


    6. Removing '@storybook/addon-styling-webpack' from `addons` returns storybook to a working state, though without postcss support still. 

### Expected behavior

Storybook should run as before, adding the plugin. 

### Screenshots and/or logs

If applicable, add screenshots and/or logs to help explain your problem.

### Environment

 - OS: Mac OS 13.6.7
 - Node.js version: 20.15.0
 - NPM version: 10.7.0
 - Browser (if applicable): NA
 - Browser version (if applicable): NA
 - Device (if applicable): NA

### Additional context

Looking at storybook core, it looks like they may have moved the node-logger about 3 weeks ago? Not sure if that effects the dist build or if it was just in src. Not sure if this is related, but here's the commit https://github.com/storybookjs/storybook/commit/8505d86feeecd13a8473fa1372cf37500519d136
ogdakke commented 1 month ago

Same issue here, on storybook@7.1.1 and addon 1.0.0. Any way to circumvent this issue for the time being?

timhecker commented 1 month ago

Same issue here, on storybook@7.6.20, addon 1.0.0 and angular framework. Someone knows if there are no issues with latest version of storybook?

thanhtran0302 commented 1 week ago

Same problem, anyone has solution ? 🙏

barisbll commented 2 days ago

I solved this issue by updating storybook to the latest version pnpm i storybook@8.2.9 , I hope it helps