Since sass-loader 12.0.0 the `@debug` doesn't work with Sass >= 1.43.4
See original GitHub issueBug report
The @debug
output in SCSS/SASS works only with:
Sass <= 1.52.3
+JS API
Sass <= 1.52.3
+sass-loader <= 11.1.1
Sass 1.43.3
+sass-loader 13.0.0
(lastest)
Used
- node v16.13.1 (npm v8.1.2)
- webpack: 5.73.0
sass
: 1.43.3 - 1.52.3sass-loader
: 11.1.1 - 13.0.0
How Do We Reproduce?
Create 3 files in a directory:
package.json
{
"scripts": {
"build": "webpack"
},
"devDependencies": {
"css-loader": "^6.7.1",
"mini-css-extract-plugin": "^2.6.0",
"sass": "^1.52.3",
"sass-loader": "^12.0.0",
"webpack": "^5.73.0",
"webpack-cli": "^4.9.2"
}
}
style.scss
$color: red;
h1 {
color: $color;
}
@debug '*** Color: #{$color}';
webpack.config.js
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
mode: 'development',
entry: {
'style': path.resolve(__dirname, "style.scss"),
},
plugins: [new MiniCssExtractPlugin()],
module: {
rules: [
{
test: /\.(css|sass|scss)$/,
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader']
},
],
},
};
Install npm modules:
npm i
Show result in console output:
npm run build
Expected
the output in console: Debug: *** Color: red
Received
- nothing.
How to view the @debug
output
Change the version of sass-loader from ^12.0.0
(or ^13.0.0
) to 11.1.1
in package.json and update npm module:
npm i
Show result in console output:
npm run build
Now you should see the output in console: Debug: *** Color: red
.
Who broke compatibility: Sass
since 1.43.4
or sass-loader
since 12.0.0
?
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
sass-loader - webpack - JS.ORG
This allows you to control the versions of all your dependencies, and to choose which Sass implementation to use. Note. We highly recommend...
Read more >Module not found: Error: Can't resolve 'sass-loader'
Go to the project and run below two commands npm install sass-loader -D npm install node-sass -D.
Read more >Breaking Change: Slash as Division - Sass
Because Sass is a CSS superset, we're matching CSS's syntax by redefining / to be only a separator. / will be treated as...
Read more >Module not found: Can't resolve 'sass-loader' | bobbyhadz
Make sure to restart your development server and your IDE if necessary. Your dev server won't pick up the changes until you stop...
Read more >sass-loader - Awesome JS
added support for sass-embedded (faster than node-sass ), feel free to feedback; added the api option ( modern api is experimental and currently...
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
@webdiscus I think wen can remove unnecessary lines
@alexander-akait
Thank you for Tip.
The webpack level option has no effect:
💡 I found how to enable
@debug
output:The output of Webpack is too “informative”:
Expected pure Debug output w/o a path to file at each line, so is the output with
sass-loader: 11.1.1
: