-
-
Notifications
You must be signed in to change notification settings - Fork 388
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
Breaking change with import via CommonJS in 2.5.0
#896
Comments
2.5.0
2.5.0
A temporary workaround is this usage:
|
If i apply this workaround and perform the webpack build command to create a production build, i get this error:
Running webpack in My workaround was to change the package.json version from: |
For anyone else running into this with an app created via
|
I've tried the resolutions method (npm), and it usually works in every situation. But not here. I had to take a different approach for our deployments to succeed.
|
It looks like the export signature got double applied? with a its also broken with importing from an mjs file... (node 17) import * as test from 'mini-css-extract-plugin'
console.log(test);
|
Breaks @wordpress/scripts |
@alexander-akait this regressed with #895 |
yeah, such change definitely should not come with minor version update |
Guys, it looks like a minor mistake. They did not intend to change the shape of the module. |
Workaround for vuejs#6943 Source cause webpack-contrib/mini-css-extract-plugin#896
We also had this issue and pegged the version at |
2.5 has an unintended API breakage: webpack-contrib/mini-css-extract-plugin#896
19 persons are listening here to get update, once the problem is fixed. Please refrain from all “Me too” comments, as these 19 persons are not interested in them. Please discuss only proposed fixes. |
Applied workaround that's described in webpack-contrib/mini-css-extract-plugin#896.
2.5 has an unintended API breakage: webpack-contrib/mini-css-extract-plugin#896
WIP, sorry for bug, my mistake |
Guys, it's open source. Relax and be patient. Take some coffee ☕ ✌️ |
2.5 has an unintended API breakage: webpack-contrib/mini-css-extract-plugin#896
Applied workaround that's described in webpack-contrib/mini-css-extract-plugin#896.
Pin mini-css-extract-plugin version. See webpack-contrib/mini-css-extract-plugin#896.
Please try https://github.com/webpack-contrib/mini-css-extract-plugin/releases/tag/v2.5.1, yes, it was bug, we should not export |
And please do not use |
Many thanks @alexander-akait for the fast fix, and for providing one of these pieces which holds the internet together! ⭐ |
Yeah, according to npm statistics, I own about 8 packages of 100 top (it is very important for all JS community), so I assigned 2 independent (and trusted) persons in the event that I cannot continue support for reasons beyond my control |
2.5 has an unintended API breakage: webpack-contrib/mini-css-extract-plugin#896
Thanks @alexander-akait |
I did the above, however now I am facing a problem further down into the code. |
@zubin-madon Please remove |
This worked for me. I replace ^ with ~ |
* Update dependency mini-css-extract-plugin to v2.5.0 * Fix MiniCssExtractPlugin require issue Refs. webpack-contrib/mini-css-extract-plugin#896 Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: aurelien-reeves <aurelien.reeves@smartbear.com>
Bug report
Since 2.5.0, importing via CommonJS no longer matches what it did in the past, or what is shown in the documentation.
Actual Behavior
This throws a
TypeError: MiniCssExtractPlugin is not a constructor
when attempting to use in the documented way. Using the exported.default
works fine, but I assume is not the intended behaviour.Expected Behavior
It should behave exactly as it did in 2.4.6 and below. This is likely the result of the change to the
main
export in 5b5654c#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L14, and the deletion of thesrc/cjs.js
script and its build.Previously in 2.4.6:
The text was updated successfully, but these errors were encountered: