webpack: 5.25.0 has broken my builds
Bug report
I have a Laravel app which uses blade.php for browser-side content, with some small <script> sections using JQuery. JQuery is part of the vendor.js chunk created by Webpack, via Laravel Mix
When build with 5.24.4, everything works as expected
What is the current behavior?
However, with 5.25, the bundles are created but when a page loads and attempts to use JQuery I get the dreaded…
ReferenceError: $ is not defined
error in the browser console.
The only difference in the created bundles appears to be the new chunk loading code in manifest.js, and the
__webpack_require__
section at the tail of each created file.
If the current behavior is a bug, please provide the steps to reproduce.
Probably difficult to provide this as it’s a large project - I will try and get a minimal example.
What is the expected behavior? “$” should be defined.
Other relevant information: webpack version: 5.25.0 Node.js version: this is a client-side issue. Operating System: Windows 10 Additional tools:
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 6
- Comments: 17 (8 by maintainers)
Commits related to this issue
- fix problem with startup of non-js initial chunks fixes #12880 — committed to webpack/webpack by sokra 3 years ago
- Squashed commit of the following: commit 58dfda2796edc57c9d18526053d6bcde6f06b8b7 Author: Tobias Koppers <tobias.koppers@googlemail.com> Date: Sun Mar 14 20:33:03 2021 +0100 5.25.1 commit 3f2... — committed to AnatidaeProject/webpack by Brian-McBride 3 years ago
Hi! I’m one of the people who works on Mix. I’d be happy to help where I can with this!
Yep this happens because we split CSS using
splitChunks
with a filename test + type: css/mini-extract + enforce: trueI thing bug on
Laravel Mix
side, as you can see no reports from other developersUnderstood. Will try and make a minimal example.