fix: add semicolon to avoid Uncaught TypeError on Webpack v5 - #561
alexander-akait merged 3 commits into
Conversation
See: #560 The compiled javascript pack is generated as follows: ``` ... /******/ // object to store loaded CSS chunks /******/ var installedCssChunks = { /******/ "common": 0 /******/ }/* webpack/runtime/jsonp chunk loading */ /******/ (() => { /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ "common": 0 /******/ }; .... ``` A missing semicolon after the closing `}` when defining `installedCssChunks` causes the object `{ "common": 0}` to be incorrectly interpreted as a function
Codecov Report
@@ Coverage Diff @@
## master #561 +/- ##
=======================================
Coverage 88.55% 88.55%
=======================================
Files 5 5
Lines 428 428
Branches 96 96
=======================================
Hits 379 379
Misses 47 47
Partials 2 2
Continue to review full report at Codecov.
|
|
Very strange what CI failed 😕 Need investigate |
|
Yeah it seems it's failing for This test is also failing on the latest Unfortunately I'm not sure I know enough about the plugin to easily debug this quickly |
|
Can you update snapshot? |
|
@evilebottnawi, @sokra - I added a new commit (bf2de3d) to update the snapshot for the failing test ( Everything passes for me locally now with webpack 5. The CI is still failing for unrelated tests, and it seems to be because of a setup/configuration issue with the test directories. These are probably outside of the scope of this fix, right? Example: Thanks again! |
|
Yes, it is outside, I will look at this tomorrow and we can do patch release |
|
@abhchand I think we need to add tests to avoid future regressions, can you do it? Just simple test (only for webpack@5) |
|
@evilebottnawi - I'll have to figure out how the tests work, so it might take me a few days. But sure, I'll give it a try. |
Adding 2 tests: * `dependOn` - Checks that `dependOn` feature works * `dependOn-multiple-files-per-entry` - Webpack 5 supports specifying multiple files per entry point in combination with the `dependOn` key Motivated by the issue described in #560
|
@evilebottnawi - I added 2 tests for the 1.
|
|
I think we can add |
|
But i think it is out work, not you, I will merge it as is and fix tests in near future (today) |
|
WIP on tests, thanks for the PR |
|
@evilebottnawi - Спасибо за вашу помощь :) |
|
@abhchand Thanks for using webpack |
This latest build includes a fix required for Webpack5 See: webpack/mini-css-extract-plugin#561
This latest build includes a fix required for Webpack5 See: webpack/mini-css-extract-plugin#561

A missing semicolon after the closing
}when defininginstalledCssChunkscauses the object{ "common": 0}to beincorrectly interpreted as a function
This PR contains a:
Motivation / Use-Case
fixes #560
The compiled javascript pack is generated by Webpack v5 as follows:
Breaking Changes
n/a
Additional Info