question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'jsonData' of undefined (webpack5 and storybook/html)

See original GitHub issue

Describe the bug I started a project using npx sb init --builder webpack5 and chose html for my future components. I cannot edit the stories because the builder breaks.

To Reproduce I start the project with npm run storybook and whenever I try to edit and save anything (like a .stories.js) the hot module restarts building but breaks immediately with an error:

webpack building...
3% setup watch run/Users/raduchiriac/Projects/-node/sb-temp/node_modules/@storybook/builder-webpack5/node_modules/webpack/lib/json/JsonGenerator.js:119
		let data = module.buildInfo.jsonData;
		                            ^

TypeError: Cannot read property 'jsonData' of undefined

System System: OS: macOS Mojave 10.14.6 CPU: (8) x64 Intel® Core™ i7-4980HQ CPU @ 2.80GHz Binaries: Node: 14.17.2 - ~/.nvm/versions/node/v14.17.2/bin/node Yarn: 1.22.10 - /usr/local/bin/yarn npm: 6.14.13 - ~/.nvm/versions/node/v14.17.2/bin/npm Browsers: Chrome: 91.0.4472.114 Firefox: 88.0 Safari: 14.1.1 npmPackages: @storybook/addon-actions: ^6.3.2 => 6.3.2 @storybook/addon-essentials: ^6.3.2 => 6.3.2 @storybook/addon-links: ^6.3.2 => 6.3.2 @storybook/builder-webpack5: ^6.3.2 => 6.3.2 @storybook/html: ^6.3.2 => 6.3.2 @storybook/manager-webpack5: ^6.3.2 => 6.3.2

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:11
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
jogelincommented, Jul 6, 2021

Seems to be fixed in webpack v5.42.1:

image

Could be fixed by setting:

package.json

...
"resolutions": {
    "webpack": "5.42.1"
  }
1reaction
raduchiriaccommented, Jul 2, 2021

It seems very much unrelated to storybook now. Focus moved here: https://github.com/webpack/webpack/issues/13691

Read more comments on GitHub >

github_iconTop Results From Across the Web

Runtime error appeared after updating to webpack 5. TypeError
Runtime error appeared after updating to webpack 5. TypeError: Cannot read properties of undefined (reading 'default') ; In config.output.
Read more >
Webpack - Storybook
Storybook is a frontend workshop for building UI components and pages in isolation. Thousands of teams use it for UI development, testing, and...
Read more >
storybook cannot read properties of undefined - You.com
The TypeError : Cannot read properties of undefined (reading 'type') exception occurs in storybook when one defines the argTypes in the default export...
Read more >
Webpack 5 upgrade #9216 - Issuehunt
node_modules@storybook\builder-webpack5\node_modules\html-webpack-plugin\lib\child- ... TypeError: Cannot read property 'data' of undefined ERR! at setData ...
Read more >
webpack-dev-middleware - npm
headers. Type: Array|Object|Function Default: undefined. This property allows a user to pass custom HTTP headers on each request ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found