-
Notifications
You must be signed in to change notification settings - Fork 358
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
Logger option not working if passed through sass-loader #1533
Comments
@nex3 Found the same problem when I try to implement own logger for |
@WIStudent I'm not sure where you got that @alexander-akait Can you provide a minimal reproduction? This works for me locally: const sass = require('sass');
const result = sass.renderSync({
data: '@warn "oh heck"',
logger: {warn: console.log}
}); |
@nex3 the main problem when I pass the |
@nex3 I misunderstood this part of the documentation:
I saw the examples for I wanted to try again using Anyway, for now I can also achieve silence by setting the const sass = require('sass');
// This passes the warning to the custom warn function
sass.renderSync({
data: '@warn "oh heck"',
logger: {
warn(message) {
console.log('My logger:', message);
}
}
});
// This does not pass the warnings to the custom warn function. Instead sass default logging is used.
sass.render({
data: '@warn "oh heck"',
logger: {
warn(message) {
console.log('My logger:', message);
}
}
}, () => {}) |
Echoing @WIStudent, where do we get |
Sorry, I didn't realize that the error was specifically with The |
These are effectively regression tests for sass/dart-sass#1533.
These are effectively regression tests for sass/dart-sass#1533.
I tried silencing messages by passing the new logger option through webpack sass-loader to sass, but they are still being printed.
I debugged into the sass-loader, and the logger option is passed together with a
file
anddata
field to sass' asyncrender
function. I think the logger option is not working because it is not passed to thecompileStringAsync
function inside therender
function.https://github.com/sass/dart-sass/blob/9678e1ae5214b41778b7c04babc4b6c9d33a7269/lib/src/node/legacy.dart#L67-88
I am using sass 1.43.2 and sass-loader 12.2.0.
The text was updated successfully, but these errors were encountered: