Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Installing Sass/ sass --watch . not working after first update

Has anyone else ran into this? I can only get my css file to update the first time I make a change after running watch. After that it will only update if I open a new terminal and re run watch.

Hayden Taylor
Hayden Taylor
5,076 Points

You are saving the .scss file? You must save the file for the .css to update.

4 Answers

Try

sass --watch your_input_file.scss:your_output_file.css --style expanded

If you have a TON of Sass compiling into css give it a moment. It usually will take a second to compile in the background then click in your CSS file again and then you should see the changes apply. Hope this helps :)

I ran sass --watch test.scss:test.css --style expanded but I still experience the same thing. I can only get the updated css file if I open a new terminal and re-run watch. Do you think this could have anything to do with where I saved it? I just saved them in my user directory. Thanks for the help Derick!

Max Hallinan
Max Hallinan
7,614 Points

Did you find a solution for this problem? I encountered the same issue when my scss file was saved to the Desktop directory. When I placed it in a subdirectory, ---watch worked.

Having same problem and noticed the terminal outputs

>>> Sass is watching for changes. Press Ctrl-C to stop.
      *write* ./Documents/camsite/test.css

Not

>>> Sass is watching for changes. Press Ctrl-C to stop.
      *overwrite* ./Documents/camsite/test.css

For an unknown, to me, reason the file can on be written to, but not over written.

Having same problem and noticed the terminal outputs

 >>> Sass is watching for changes. Press Ctrl-C to stop.
 write ./Documents/camsite/test.css 

Not

 >>> Sass is watching for changes. Press Ctrl-C to stop.
 overwrite ./Documents/camsite/test.css

For an unknown, to me, reason the file can on be written to, but not over written.

Momentum , LLC
Momentum , LLC
12,660 Points

I was having a similar issue, i had my project set up inside a document named web/media and and was sass wasn't writing any of my changes to the css file. For me the issue was the folder name "web/media", changed it to "web-media" and everything works just fine.