webpack-contrib / webpack-bundle-analyzer

Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap
MIT License
12.58k stars 487 forks source link

check this.compiler.outputFileSystem.constructor is not undefined #447

Closed kedarv closed 3 years ago

kedarv commented 3 years ago

via https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/384#issuecomment-838827301

In some cases, this.compiler.outputFileSystem.constructor can be undefined, causing access to properties on this to fail. This PR adds a check to prevent this.

alexander-akait commented 3 years ago

/cc @valscion Can we add tests late? I can send tests late, right now I am busy with webpack-dev-server

valscion commented 3 years ago

Yeah we can add tests later to get this bug fix out.

I'll copy over what I wrote in https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/384#issuecomment-842324202 to here:

as long as there are no tests, it's possible that we'll break the fix even in a patch release as there is no way we can make sure that this fix doesn't suddenly stop working unless we have test coverage for that.

alexander-akait commented 3 years ago

@valscion It looks like I'll have to waste time on a pretty obvious bug :confused: :disappointed:

valscion commented 3 years ago

I'll get this bug fix out, no worries about that. I'm merely noting the effect a missing test coverage has for this kind of bug fix.

It's not possible for us to keep this bug fix working for sure if we do changes to the code later. Reproducing the bug takes effort we're not willing to do every time we change the code.

valscion commented 3 years ago

I do appreciate @alexander-akait you reproducing the original issue in #384! It was very helpful ☺️ it makes it possible for us to ship this fix even without test coverage, and I do appreciate that πŸ’ž

alexander-akait commented 3 years ago

Can you try using this https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/384#issuecomment-838569309? Do you see the error? Just want check it out too

valscion commented 3 years ago

Yes I see the error with the reproduction

vesa_Vesas-MBP____code_muut_webpack-bundle-analyzer_issue-384-repro
valscion commented 3 years ago

This fix has been released in v4.4.2 πŸŽ‰