dart-sass
dart-sass copied to clipboard
Recover from errors so that multiple errors can be reported at once
Hi,
dart-sass displays error messages on css-file, which is very useful but it displays only the first error on every file. If i make another mistake on the same sass-file, it shows nothing. This must be a bug
Recovering from an error well enough to print additional errors isn't trivial. For syntax errors, it requires every location that can produce an error to have some notion of how to get back into a somewhat-sensible state. For runtime errors, it's not possible in general, since any error could cause the entire rest of the computation to be invalid. However, we could potentially recover when a runtime error occurs outside of a variable assignment, since that's just going to produce CSS.
Even then, collecting those errors and producing reasonable output (and a reasonable API representation) for them is non-trivial. But this could be a nice UX feature, so I'll leave it open, if low-priority.
I am not sure if we are talking about the same thing and also not so professional about this subject but it is not possible working with dart-sass in this way. I will try to explain:
I opened '_block.scss' and delted '{' which is required and refreshed the page, got the error message below:
and then deleted lots of '{', ';', '*/'. at the end I got no error report but my style.css is compiled totally different. So I have to find all the syntax errors manually.
And I have just tried something new. If I delete index of a css file (after first error) it has no effect on result. Or deletin ".nav-links" for all sass files has no effect on style.css either.(with empty browser cache)
How can this be? This is very strange. Please try it by yourself. This sass compiler is not working properly.
The error-report of Ruby-Sass is working very well but Ruby-Sass is really slow.
and then deleted lots of '{', ';', '*/'. at the end I got no error report but my style.css is compiled totally different. So I have to find all the syntax errors manually.
I don't understand exactly what this means. When you deleted those characters, did the initial error still exist in the file? In what was was style.css compiled differently?
It would help if you could include an example Sass input file, the output you expect from it, and the output you're actually getting.