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] (preset-create-react-app) [webpack-dev-middleware] TypeError: Cannot read property 'length' of undefined when updating to SB 6.3 and WebPack 5. #207

Open
enrique-ramirez opened this issue Jul 12, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@enrique-ramirez
Copy link

enrique-ramirez commented Jul 12, 2021

Describe the bug

From an existing storybook installation with SB 6.2 and WP 4, I'm attempting to update to SB 6.3 and WP 5. I've added both @storybook/builder-webpack5 and @storybook/manager-webpack5. This is a fairly straightforward installation without much customization to it. I keep getting the following error:

<i> [webpack-dev-middleware] wait until bundle finished
<e> [webpack-dev-middleware] TypeError: Cannot read property 'length' of undefined
<e>     at /myProject/node_modules/react-scripts/node_modules/webpack-manifest-plugin/lib/plugin.js:129:39
<e>     at Array.reduce (<anonymous>)
<e>     at ManifestPlugin.<anonymous> (/myProject/node_modules/react-scripts/node_modules/webpack-manifest-plugin/lib/plugin.js:116:26)
<e>     at _next1 (eval at create (/myProject/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:31:1)
<e>     at eval (eval at create (/myProject/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:69:1)
<e>     at emit (/myProject/node_modules/fork-ts-checker-webpack-plugin/lib/index.js:274:17)
<e>     at Hook.eval [as callAsync] (eval at create (/myProject/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:63:1)
<e>     at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/myProject/node_modules/webpack/node_modules/tapable/lib/Hook.js:18:14)
<e>     at Compiler.emitAssets (/myProject/node_modules/webpack/lib/Compiler.js:862:19)
<e>     at /myProject/node_modules/webpack/lib/Watching.js:155:21
<e>     at processTicksAndRejections (internal/process/task_queues.js:77:11)
(node:15035) [DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET] DeprecationWarning: Compilation.chunks was changed from Array to Set (using Array method 'reduce' is deprecated)

Expected behavior

Storybook to start without issues.

Environment

  • OS: MacOSX 11.4
  • Node.js version: 14.17.1
  • NPM version: 6.14.13

UPDATE: It has brought to my attention that create react app is not compatible with webpack 5, so this makes total sense.

@tedesco8
Copy link

No solution yet?

@imki123
Copy link

imki123 commented Dec 14, 2022

It works for me. storybookjs/storybook#14789 (comment)

  • main.js > /* "@storybook/preset-create-react-app" */

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

3 participants