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

Webpack v5 Upgrade - build-storybook fails #14130

Closed
marjisound opened this issue Mar 4, 2021 · 1 comment
Closed

Webpack v5 Upgrade - build-storybook fails #14130

marjisound opened this issue Mar 4, 2021 · 1 comment

Comments

@marjisound
Copy link

Describe the bug
Hi, we are trying to upgrade our project to webpack 5. But build-storybook fails with the following error:

			throw new TypeError(
			^

TypeError: The 'compilation' argument must be an instance of Compilation
    at Function.getCompilationHooks (/Users/marjank/code/apps-rendering/node_modules/webpack/lib/javascript/JavascriptModulesPlugin.js:112:10)
    at /Users/marjank/code/apps-rendering/node_modules/terser-webpack-plugin/dist/index.js:571:67
    at SyncHook.eval [as call] (eval at create (/Users/marjank/code/apps-rendering/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:85:1)
    at SyncHook.lazyCompileHook (/Users/marjank/code/apps-rendering/node_modules/tapable/lib/Hook.js:154:20)
    at Compiler.newCompilation (/Users/marjank/code/apps-rendering/node_modules/@storybook/core/node_modules/webpack/lib/Compiler.js:631:26)
    at /Users/marjank/code/apps-rendering/node_modules/@storybook/core/node_modules/webpack/lib/Compiler.js:667:29
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/marjank/code/apps-rendering/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:4:1)
    at AsyncSeriesHook.lazyCompileHook (/Users/marjank/code/apps-rendering/node_modules/tapable/lib/Hook.js:154:20)
    at Compiler.compile (/Users/marjank/code/apps-rendering/node_modules/@storybook/core/node_modules/webpack/lib/Compiler.js:662:28)
    at /Users/marjank/code/apps-rendering/node_modules/@storybook/core/node_modules/webpack/lib/Compiler.js:321:11
    at Array.<anonymous> (/Users/marjank/code/apps-rendering/node_modules/@storybook/core/node_modules/webpack/lib/Compiler.js:534:20)
    at Storage.finished (/Users/marjank/code/apps-rendering/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /Users/marjank/code/apps-rendering/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
    at callback (/Users/marjank/code/apps-rendering/node_modules/graceful-fs/polyfills.js:295:20)
    at FSReqCallback.oncomplete (fs.js:168:21)
npm ERR! code ELIFECYCLE
npm ERR! errno 1

Could you please guide me on what things I can try. I went through all the comments and updates in #9216
I also tried different alpha versions including #13808

To Reproduce
Upgrade Webpack
Upgraded storybook to the latest version
Running build-storybook fails (But start-storybook works fine!!)

System
"@storybook/addon-essentials": "^6.1.21",
"@storybook/addon-knobs": "^6.1.21",
"@storybook/addon-storyshots": "^6.1.21",
"@storybook/react": "^6.1.21",
"@storybook/storybook-deployer": "^2.8.7"

Node:: v12.20.0
NPM: 6.14.8

@shilman
Copy link
Member

shilman commented Mar 4, 2021

closing as dupe to #13893

@shilman shilman closed this as completed Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants