-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
import styles undefined #4277
Comments
@HuXin957 Hello there! I'm here to help you with your GitHub issues while waiting for a human maintainer. I'm a bot named Dosu, and I can assist you with bug fixes, answer your questions, and guide you on becoming a contributor. The issue you're encountering where
If these steps do not resolve the issue, there might be a deeper configuration problem or a compatibility issue with the versions of the tools you are using. |
first,thanks. but, that can't solve my problem |
You may need to pay attention to the version of css-loader . |
As the document write : My configuration does not explicitly specify the esmodule configuration item as true, but when i add log in the node_mdoules/css-loader/utils.js getModulesOptions, it print the namedExport is true. so i get the import variable is undefined. When I explicitly specify the namedExport field as false, it runs normally. According to the document, isn't this field set to false by default ? |
|
To reproduce:
import styles from './index.less';
Current behavior:
Expected behavior:
I hope "className= { styles.main }" can work
first, why is that?
secondly, how to fix it?
Environment information:
less
version:4.1.3less-loader
version:11.1.0nodejs
version:20.11.1operating system
:macThe text was updated successfully, but these errors were encountered: