You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Using svelte with webpack 5 and storybook doesn't work.
The command npm run storybook, gives the following error:
npm run storybook
>[email protected] storybook /home/josel/devProjects/disgraça
> start-storybook -p 6006
info @storybook/svelte v6.3.12
info
info => Loading presets
info => Loading 1 config file in"/home/josel/devProjects/disgraça/.storybook"
info => Loading 9 other files in"/home/josel/devProjects/disgraça/.storybook"
info => Adding stories defined in"/home/josel/devProjects/disgraça/.storybook/main.js"
info => Using implicit CSS loaders
info => Using default Webpack4 setup
(node:16212) 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.
0% compilingERR! TypeError: Cannot read property 'get' of undefined
ERR! at /home/josel/devProjects/disgraça/node_modules/webpack/lib/DefinePlugin.js:292:38
ERR! at SyncHook.eval [as call] (eval at create (/home/josel/devProjects/disgraça/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:11:1)
ERR! at SyncHook.lazyCompileHook (/home/josel/devProjects/disgraça/node_modules/tapable/lib/Hook.js:154:20)
ERR! at Compiler.newCompilation (/home/josel/devProjects/disgraça/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/Compiler.js:631:26)
ERR! at /home/josel/devProjects/disgraça/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/Compiler.js:667:29
ERR! at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/josel/devProjects/disgraça/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:4:1)
ERR! at AsyncSeriesHook.lazyCompileHook (/home/josel/devProjects/disgraça/node_modules/tapable/lib/Hook.js:154:20)
ERR! at Compiler.compile (/home/josel/devProjects/disgraça/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/Compiler.js:662:28)
ERR! at /home/josel/devProjects/disgraça/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/Watching.js:77:18
ERR! at _next0 (eval at create (/home/josel/devProjects/disgraça/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:23:1)
ERR! at eval (eval at create (/home/josel/devProjects/disgraça/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:32:1)
ERR! at watchRunHook (/home/josel/devProjects/disgraça/node_modules/webpack-virtual-modules/index.js:173:5)
ERR! at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/josel/devProjects/disgraça/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:28:1)
ERR! at AsyncSeriesHook.lazyCompileHook (/home/josel/devProjects/disgraça/node_modules/tapable/lib/Hook.js:154:20)
ERR! at Watching._go (/home/josel/devProjects/disgraça/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/Watching.js:41:32)
ERR! at /home/josel/devProjects/disgraça/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/Watching.js:33:9
ERR! TypeError: Cannot read property 'get' of undefined
ERR! at /home/josel/devProjects/disgraça/node_modules/webpack/lib/DefinePlugin.js:292:38
ERR! at SyncHook.eval [as call] (eval at create (/home/josel/devProjects/disgraça/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:11:1)
ERR! at SyncHook.lazyCompileHook (/home/josel/devProjects/disgraça/node_modules/tapable/lib/Hook.js:154:20)
ERR! at Compiler.newCompilation (/home/josel/devProjects/disgraça/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/Compiler.js:631:26)
ERR! at /home/josel/devProjects/disgraça/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/Compiler.js:667:29
ERR! at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/josel/devProjects/disgraça/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:4:1)
ERR! at AsyncSeriesHook.lazyCompileHook (/home/josel/devProjects/disgraça/node_modules/tapable/lib/Hook.js:154:20)
ERR! at Compiler.compile (/home/josel/devProjects/disgraça/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/Compiler.js:662:28)
ERR! at /home/josel/devProjects/disgraça/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/Watching.js:77:18
ERR! at _next0 (eval at create (/home/josel/devProjects/disgraça/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:23:1)
ERR! at eval (eval at create (/home/josel/devProjects/disgraça/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:32:1)
ERR! at watchRunHook (/home/josel/devProjects/disgraça/node_modules/webpack-virtual-modules/index.js:173:5)
ERR! at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/josel/devProjects/disgraça/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:28:1)
ERR! at AsyncSeriesHook.lazyCompileHook (/home/josel/devProjects/disgraça/node_modules/tapable/lib/Hook.js:154:20)
ERR! at Watching._go (/home/josel/devProjects/disgraça/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/Watching.js:41:32)
ERR! at /home/josel/devProjects/disgraça/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/Watching.js:33:9 {
ERR! stack: "TypeError: Cannot read property 'get' of undefined\n" +
ERR!' at /home/josel/devProjects/disgraça/node_modules/webpack/lib/DefinePlugin.js:292:38\n' +
ERR!' at SyncHook.eval [as call] (eval at create (/home/josel/devProjects/disgraça/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:11:1)\n' +
ERR!' at SyncHook.lazyCompileHook (/home/josel/devProjects/disgraça/node_modules/tapable/lib/Hook.js:154:20)\n' +
ERR!' at Compiler.newCompilation (/home/josel/devProjects/disgraça/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/Compiler.js:631:26)\n' +
ERR!' at /home/josel/devProjects/disgraça/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/Compiler.js:667:29\n' +
ERR!' at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/josel/devProjects/disgraça/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:4:1)\n' +
ERR!' at AsyncSeriesHook.lazyCompileHook (/home/josel/devProjects/disgraça/node_modules/tapable/lib/Hook.js:154:20)\n' +
ERR!' at Compiler.compile (/home/josel/devProjects/disgraça/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/Compiler.js:662:28)\n' +
ERR!' at /home/josel/devProjects/disgraça/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/Watching.js:77:18\n' +
ERR!' at _next0 (eval at create (/home/josel/devProjects/disgraça/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:23:1)\n' +
ERR!' at eval (eval at create (/home/josel/devProjects/disgraça/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:32:1)\n' +
ERR!' at watchRunHook (/home/josel/devProjects/disgraça/node_modules/webpack-virtual-modules/index.js:173:5)\n' +
ERR!' at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/josel/devProjects/disgraça/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:28:1)\n' +
ERR!' at AsyncSeriesHook.lazyCompileHook (/home/josel/devProjects/disgraça/node_modules/tapable/lib/Hook.js:154:20)\n' +
ERR!' at Watching._go (/home/josel/devProjects/disgraça/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/Watching.js:41:32)\n' +
ERR!' at /home/josel/devProjects/disgraça/node_modules/@storybook/builder-webpack4/node_modules/webpack/lib/Watching.js:33:9'
ERR! }
To Reproduce
get svelte webpack5 template npx degit sveltejs/template-webpack my-app
navigate to app folder and install storybook cd my-appnpx sb init
Additional context
After removing webpack from my package, deleting node_modules, and reinstalling everything, the storybook works. I think that some module has webpack as a peer dependency, since my project uses webpack5 and the default storybook's webpack is v4, the npm can't flatten the dependencies and this module ends up using my webpack5.
The text was updated successfully, but these errors were encountered:
we still need to update the official documentation
any chance you could try out the latest beta and see if our automigration works for you? in a fresh project, install npx sb@next init then run npx sb@next automigrate.
We’re cleaning house! Storybook has changed a lot since this issue was created and we don’t know if it’s still valid. Please open a new issue referencing this one if:
Describe the bug
Using svelte with webpack 5 and storybook doesn't work.
The command
npm run storybook
, gives the following error:To Reproduce
npx degit sveltejs/template-webpack my-app
cd my-app
npx sb init
npm i
npm run storybook
System
Additional context
After removing webpack from my package, deleting node_modules, and reinstalling everything, the storybook works. I think that some module has webpack as a peer dependency, since my project uses webpack5 and the default storybook's webpack is v4, the npm can't flatten the dependencies and this module ends up using my webpack5.
The text was updated successfully, but these errors were encountered: