You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Beginning with version 7.0.0, importing CSS modules works only if the as syntax is used.
Using "allowSyntheticDefaultImports": true, "esModuleInterop": true intsconfig.json doesn't help
Actual Behavior
if importing without * as like this import styles from "./counter.module.css"; it throws the error "TypeError: Cannot read properties of undefined (reading 'button')"
Expected Behavior
importing import styles from "./counter.module.css"; shouldn't throws errors
How Do We Reproduce?
Import CSS modules without * as syntax
Please paste the results of npx webpack-cli info here, and mention other relevant information
Bug report
Beginning with version 7.0.0, importing CSS modules works only if the as syntax is used.
Using
"allowSyntheticDefaultImports": true, "esModuleInterop": true
intsconfig.json
doesn't helpActual Behavior
if importing without
* as
like thisimport styles from "./counter.module.css";
it throws the error "TypeError: Cannot read properties of undefined (reading 'button')"Expected Behavior
importing
import styles from "./counter.module.css";
shouldn't throws errorsHow Do We Reproduce?
Import CSS modules without
* as
syntaxPlease paste the results of
npx webpack-cli info
here, and mention other relevant informationSystem:
OS: macOS 14.5
CPU: (8) arm64 Apple M1
Memory: 86.63 MB / 8.00 GB
Binaries:
Node: 20.12.1 - /usr/local/bin/node
Yarn: 1.22.22 - /usr/local/bin/yarn
npm: 10.5.0 - /usr/local/bin/npm
Browsers:
Chrome: 125.0.6422.78
Safari: 17.5
Packages:
css-loader: ^7.1.0 => 7.1.2
css-minimizer-webpack-plugin: ^7.0.0 => 7.0.0
html-webpack-plugin: ^5.6.0 => 5.6.0
style-loader: ^4.0.0 => 4.0.0
ts-loader: ^9.5.1 => 9.5.1
webpack: ^5.91.0 => 5.91.0
webpack-cli: ^5.1.4 => 5.1.4
webpack-dev-server: ^5.0.4 => 5.0.4
Global Packages:
webpack-cli: 5.1.4
webpack: 5.91.0
The text was updated successfully, but these errors were encountered: