Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
seamus-sc opened this issue Jul 10, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@seamus-sc
Copy link

seamus-sc commented Jul 10, 2024

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:
- ./node_modules/@storybook/addon-styling-webpack/node_modules/@storybook/node-logger/shim.js
- ./node_modules/@storybook/addon-styling-webpack/dist/preset.js
- ./node_modules/@storybook/core-common/dist/index.js
- ./node_modules/@storybook/telemetry/dist/index.js
- ./node_modules/@storybook/cli/dist/generate.js
- ./node_modules/@storybook/cli/bin/index.js
- ./node_modules/storybook/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
    at Module._resolveFilename (./node_modules/esbuild-register/dist/node.js:4799:36)
    at Module._load (node:internal/modules/cjs/loader:986:27)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (./node_modules/@storybook/addon-styling-webpack/node_modules/@storybook/node-logger/shim.js:1:18)
    at Module._compile (node:internal/modules/cjs/loader:1358:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Object.newLoader (./node_modules/esbuild-register/dist/node.js:2262:9)
    at extensions..js (./node_modules/esbuild-register/dist/node.js:4838:24)
    at loadPreset (./node_modules/@storybook/core-common/dist/index.js:15:82)
    at loadPreset (./node_modules/@storybook/core-common/dist/index.js:15:82)
    at async Promise.all (index 1)
    at async loadPresets (./node_modules/@storybook/core-common/dist/index.js:15:505)
    at async getPresets (./node_modules/@storybook/core-common/dist/index.js:15:1525)
    at async buildDevStandalone (./node_modules/@storybook/core-server/dist/index.js:119:1696)
    at async withTelemetry (./node_modules/@storybook/core-server/dist/index.js:65:3948)
    at async dev (./node_modules/@storybook/cli/dist/generate.js:514:401)
    at async Command.<anonymous> (./node_modules/@storybook/cli/dist/generate.js:529:225)

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 storybookjs/storybook@8505d86

@seamus-sc seamus-sc added the bug Something isn't working label Jul 10, 2024
@seamus-sc seamus-sc changed the title [Bug] [Bug] Installing on an existing 7.6.17 causes storybook to crash Jul 10, 2024
@seamus-sc seamus-sc changed the title [Bug] Installing on an existing 7.6.17 causes storybook to crash [Bug] Installing on an existing 7.6.17 causes storybook to crash -- can't find node_logger Jul 10, 2024
@seamus-sc seamus-sc changed the title [Bug] Installing on an existing 7.6.17 causes storybook to crash -- can't find node_logger [Bug] Installing on an existing 7.6.17 causes storybook to crash -- can't find module node-logger Jul 10, 2024
@ogdakke
Copy link

ogdakke commented Jul 11, 2024

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

@timhecker
Copy link

timhecker commented Aug 2, 2024

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
Copy link

Same problem, anyone has solution ? 🙏

@barisbll
Copy link

barisbll commented Sep 5, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants