Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS Sass Basics Add Reusable Logic to Your Sass Handling Errors with @error and @warn

Steve Gallant
Steve Gallant
14,915 Points

Compiler stops and removes styles.css for both @error and @warning

I'm working through the course locally on my workstation. When I use the @error or @warning directives and feed in a bogus argument, the styles.css file actually disappears from the css folder. The compiler spits out an error, but there is nothing in the browser console except stating it cannot find the styles.css.

Update in behavior?

thanks, Steve

Same for me

Bryan Land
Bryan Land
10,269 Points

I noticed this as well when using VSCode where if there are no issues, the css output is generated just fine but once you have an error at all, even without inserting debugging directives like @error or @warn, it will delete the output file completely.

Luckily the debug and error messages still appear in the terminal you are running --watch in. Could be related this this bug.

What editors are you using locally?

For me I am using VS Code, and as Bryan Land suggested, I am also running sass --watch scss:css

Bryan Land
Bryan Land
10,269 Points

I want to add that using the @warn directive, it does still compile. This is a peculiar issue but isn't a huge deal. If Guil Hernandez knows anything about it, maybe he will grace us with his presence in this thread! Cheers!

Funny thing, in a later lesson @error and @warn work as it should, but I'm not sure why it works there and not here. I am using VS Code and running sass --watch scss:css