storybookjs / addon-styling-webpack

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

[Bug] `npx storybook@latest add @storybook/addon-styling-webpack` throw and error #4

Closed javierlopezdeancos closed 8 months ago

javierlopezdeancos commented 1 year ago

Describe the bug

A clear and concise description of what the bug is.

Steps to reproduce the behavior

  1. Go to your storybook project
  2. Execute npx storybook@latest add @storybook/addon-styling-webpack
  3. See error

Expected behavior

Should install addon-styling-webpack and works as expected.

Screenshots and/or logs

Need to install the following packages:
  storybook@7.4.0
Ok to proceed? (y) y
Verifying @storybook/addon-styling-webpack
Installing @storybook/addon-styling-webpack@^0.0.3
Adding '@storybook/addon-styling-webpack' to main.js addons field.
Running postinstall script for @storybook/addon-styling-webpack
Error running postinstall script for @storybook/addon-styling-webpack
TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received undefined
at new NodeError (node:internal/errors:399:5)
    at validateString (node:internal/validators:163:11)
    at normalizeSpawnArguments (node:child_process:545:3)
    at Object.spawn (node:child_process:750:13)
    at t (/Users/javierlopezdeancos/Code/AtomicJar/tcc-web/node_modules/@storybook/addon-styling-webpack/bin/postinstall.js:5:130)
    at postinstallAddon (/Users/javierlopezdeancos/.npm/_npx/bc7e1e37fcb46ffc/node_modules/@storybook/cli/dist/generate.js:172:834)
    at add (/Users/javierlopezdeancos/.npm/_npx/bc7e1e37fcb46ffc/node_modules/@storybook/cli/dist/generate.js:172:2421) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Environment

ShaunEvening commented 1 year ago

Hey @javierlopezdeancos 👋

I'm just trying to hunt down that issue for that now!

In the mean time, please run this command instead:

npx @storybook/auto-config styling

javierlopezdeancos commented 1 year ago

Hey @Integrayshaun thanks for the fast feedback

with npx @storybook/auto-config styling the result in terminal looks well

Captura de pantalla 2023-09-01 a las 11 59 00 Captura de pantalla 2023-09-01 a las 12 00 19

But the css modules imported in my next app looks that continues not imported in the storybook app 😕

ShaunEvening commented 1 year ago

Hey @javierlopezdeancos

Oh! I didn't realize this was for a next app. This should already be handled by the @storybook/nextjs framework. Using @storybook/addon-styling-webpack as well would likely break more than it would fix