sass-loader can't resolve :global or :local on css-module on .sass extension
See original GitHub issue:global
and :local
isn’t working with sass-loader with .sass extension
I tried to switch to less and stylus loader and it works perfectly. Not sure this is my fault in configuration ? or just sass syntax doesn’t allow :global
and :local


{
test: /\.sass$/,
use: [{
loader: 'style-loader'
}, {
loader: 'css-loader',
options: {
modules: true,
localIdentName: '[name]-[local]-[hash:base64]'
}
},
{
loader: 'postcss-loader'
}, {
loader: 'sass-loader'
}]
},
SOLUTION: If anyone get this problem, /:global
will fix the problem.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:17 (7 by maintainers)
Top Results From Across the Web
Can't import CSS/SCSS modules. TypeScript says "Cannot ...
In a webpack configuration that pipes *.scss files through sass-loader → css-loader → style-loader, there will be no content in the imported module, ......
Read more >sass-loader - webpack - JS.ORG
The sass-loader uses Sass's custom importer feature to pass all queries to the Webpack resolving engine. Thus you can import your Sass modules...
Read more >How to Use Sass with CSS Modules in Next.js - freeCodeCamp
Next.js gives us CSS Modules by default, providing benefits like scoped styles ... Step 4: Using Sass mixins with global imports in Next.js....
Read more >Sass: @import
Sass extends CSS's @import rule with the ability to import Sass and CSS stylesheets, providing access to mixins, functions, and variables and combining ......
Read more >Configuration - Nuxt
You will still need to install the required loader if you need to use them. Style Extensions. You can omit the file extension...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
escaping is possible using
\:global
not/:global
@thomashibbard what worked for me was something like: