storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
83.98k stars 9.23k forks source link

[Bug]: Storybook doesn't run on a fresh Nuxt 3 app #21815

Closed ncphillips closed 1 year ago

ncphillips commented 1 year ago

Describe the bug

I created a fresh Nuxt 3 app and tried to add storybook.

Storybook doesn't run when you try to install it on a brand new Nuxt 3 app

$ start-storybook -p 6006
info @storybook/vue3 v6.5.16
info 
✔ Port 6006 is not available. Would you like to run Storybook on port 6007 instead? … yes
info => Loading presets

info Addon-docs: using MDX1
info => Using implicit CSS loaders
info => Using default Webpack4 setup
(node:72039) DeprecationWarning: Default PostCSS plugins are deprecated. When switching to '@storybook/addon-postcss',
you will need to add your own plugins, such as 'postcss-flexbugs-fixes' and 'autoprefixer'.

See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated-default-postcss-plugins for details.
(Use `node --trace-deprecation ...` to show where the warning was created)
0% compilingERR! TypeError: Cannot read properties of undefined (reading 'get')
ERR!     at /Users/nolan/Code/my-app/node_modules/@storybook/vue3/node_modules/webpack/lib/DefinePlugin.js:292:38
ERR!     at SyncHook.eval [as call] (eval at create (/Users/nolan/Code/my-app/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:15:1)
ERR!     at SyncHook.lazyCompileHook (/Users/nolan/Code/my-app/node_modules/tapable/lib/Hook.js:154:20)
ERR!     at Compiler.newCompilation (/Users/nolan/Code/my-app/node_modules/webpack/lib/Compiler.js:631:26)
ERR!     at /Users/nolan/Code/my-app/node_modules/webpack/lib/Compiler.js:667:29
ERR!     at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/nolan/Code/my-app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
ERR!     at AsyncSeriesHook.lazyCompileHook (/Users/nolan/Code/my-app/node_modules/tapable/lib/Hook.js:154:20)
ERR!     at Compiler.compile (/Users/nolan/Code/my-app/node_modules/webpack/lib/Compiler.js:662:28)
ERR!     at /Users/nolan/Code/my-app/node_modules/webpack/lib/Watching.js:77:18
ERR!     at _next0 (eval at create (/Users/nolan/Code/my-app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:25:1)
ERR!  TypeError: Cannot read properties of undefined (reading 'get')
ERR!     at /Users/nolan/Code/my-app/node_modules/@storybook/vue3/node_modules/webpack/lib/DefinePlugin.js:292:38
ERR!     at SyncHook.eval [as call] (eval at create (/Users/nolan/Code/my-app/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:15:1)
ERR!     at SyncHook.lazyCompileHook (/Users/nolan/Code/my-app/node_modules/tapable/lib/Hook.js:154:20)
ERR!     at Compiler.newCompilation (/Users/nolan/Code/my-app/node_modules/webpack/lib/Compiler.js:631:26)
ERR!     at /Users/nolan/Code/my-app/node_modules/webpack/lib/Compiler.js:667:29
ERR!     at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/nolan/Code/my-app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
ERR!     at AsyncSeriesHook.lazyCompileHook (/Users/nolan/Code/my-app/node_modules/tapable/lib/Hook.js:154:20)
ERR!     at Compiler.compile (/Users/nolan/Code/my-app/node_modules/webpack/lib/Compiler.js:662:28)
ERR!     at /Users/nolan/Code/my-app/node_modules/webpack/lib/Watching.js:77:18
ERR!     at _next0 (eval at create (/Users/nolan/Code/my-app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:25:1)

WARN Broken build, fix the error above.
WARN You may need to refresh the browser.

info => Loading presets
error Command failed with exit code 1.

To Reproduce

npx nuxi@latest init my-app

cd my-app
yarn

npx storybook init --type vue3
yarn storybook

System

No response

Additional context

No response

scscgit commented 1 year ago

Related Nuxt modules and their open issues:

Have there been any updates for the last couple of months?

ncphillips commented 1 year ago

not sure what "updates" meants

I tried again a couple times and couldn't get it working. Haven't tried in a couple weeks though.

scscgit commented 1 year ago

Yes, I meant that this issue is being completely ignored by everyone :(

hirotaka commented 1 year ago

I just released an add-on to simplify Storybook setup in Nuxt3 projects. I have completed my necessary features, but more features may be required. I would appreciate your feedback on this 😉

https://github.com/hirotaka/storybook-addon-nuxt

shilman commented 1 year ago

Closing as dupe to #20312