Closed DavidHenri008 closed 3 years ago
Please use github repo to provide example and steps
And do not ignore How Do We Reproduce?
, otherwise it will be closed without help
I will try to add an exemple. Thanks
Yes, regression, workaround - change exclude: [/^$/, /\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/],
on exclude: [/^$/, /\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/, /\.webpack/],
Let's close in favor https://github.com/webpack-contrib/mini-css-extract-plugin/issues/847, sounds like another problem, but the essence of the problem is the same
@alexander-akait Unfortunately this issue still exists in version v2.4.2. You can still reproduce the issue in the repo above.
Here fix https://github.com/webpack/webpack/pull/14435, you need to wait webpack release
I confirm that the mini-css-extract-plugin v2.4.2 and webpack 5.58.1 works now properly together. Thank you very much!
Bug report
The newer v2.4.0 and v2.4.1 cause an error when importing css module. However, everything works fine with v2.3.0.
Actual Behavior
I have a CSS module file.
I have a React file.
I have the default webpack config from Create React App.
I am getting the following error:
Attempted import error: './index.module.css' does not contain a default export (imported as 'styles').
Expected Behavior
I am expecting to get the same result as with v2.3.0, meaning being able to use the property filterLinesIcon from the styles object.
How Do We Reproduce?
Here is a repo to reproduce it. Simply execute
yarn build
to see the error. If you replace the version in thepackages.json
frommini-css-extract-plugin": "2.4.1
tomini-css-extract-plugin": "2.3.0
, it works.Please paste the results of
npx webpack-cli info
here, and mention other relevant informationSystem: OS: Windows 10 10.0.19043 CPU: (8) x64 Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz Memory: 14.37 GB / 31.88 GB Binaries: Node: 14.17.6 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
npm: 7.18.1 - C:\Program Files\nodejs\npm.CMD Browsers: Chrome: 94.0.4606.71 Edge: Spartan (44.19041.1023.0), Chromium (94.0.992.38) Internet Explorer: 11.0.19041.1202 Monorepos: Yarn Workspaces: 1.22.10 Lerna: 4.0.0 Packages: case-sensitive-paths-webpack-plugin: 2.4.0 => 2.4.0 compression-webpack-plugin: 9.0.0 => 9.0.0 css-minimizer-webpack-plugin: 3.1.1 => 3.1.1 duplicate-package-checker-webpack-plugin: 3.0.0 => 3.0.0 eslint-webpack-plugin: 3.0.1 => 3.0.1 filemanager-webpack-plugin: 6.1.7 => 6.1.7 html-webpack-plugin: 5.3.2 => 5.3.2 node-polyfill-webpack-plugin: 1.1.4 => 1.1.4 terser-webpack-plugin: 5.2.4 => 5.2.4 webpack: 5.57.1 => 5.57.1 webpack-bundle-analyzer: 4.4.2 => 4.4.2 webpack-dev-server: 4.3.1 => 4.3.1 webpack-manifest-plugin: 4.0.2 => 4.0.2 workbox-webpack-plugin: 6.3.0 => 6.3.0