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

getSize() throws errors if no module.buildInfo #13707

Closed
wants to merge 1 commit into from

Conversation

bthorben
Copy link

@bthorben bthorben commented Jul 5, 2021

Building my project, I can see that sometimes a module has no buildInfo. In this case, it would be better to also return a size = 0 than to throw an error.

I currently experience these errors a lot, which disappear with this simple fix:

[...]/node_modules/webpack/lib/json/JsonGenerator.js:119
let data = module.buildInfo.jsonData;
^
TypeError: Cannot read property 'jsonData' of undefined

What kind of change does this PR introduce?

Did you add tests for your changes?

Does this PR introduce a breaking change?

What needs to be documented once your changes are merged?

Building my project, I can see that sometimes a module has no buildInfo. In this case, it would be better to also return a size = 0 than to throw an error. 

I currently experience these errors a lot, which disappear with this simple fix: 

>> [...]/node_modules/webpack/lib/json/JsonGenerator.js:119
>>   let data = module.buildInfo.jsonData;
>>                                               ^
>>   TypeError: Cannot read property 'jsonData' of undefined
@webpack-bot
Copy link
Contributor

For maintainers only:

  • This needs to be documented (issue in webpack/webpack.js.org will be filed when merged)
  • This needs to be backported to webpack 4 (issue will be created when merged)

@sokra
Copy link
Member

sokra commented Jul 5, 2021

fixed by #13708

@webpack-bot
Copy link
Contributor

@bthorben The most important CI builds failed. This way your PR can't be merged.

Please take a look at the CI results from azure (15 errors / 1 warnings) and appveyor (failure) and fix these issues.

@sokra sokra closed this Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants