5

So I've read Sass watch is detecting changes but not compiling to css and many other places, but nothing seems to help me. When the .css file is first created, it returns that it has made 'front-page.css' etc. This all works, until you continue to make updates and it just says 'Change detected to: ...' but doesn't update the .css file. Any idea as to why this is happening? Thanks!

From the terminal:

sass --watch scss/front-page.scss:front-page.css
>>> Sass is watching for changes. Press Ctrl-C to stop.
[Listen warning]:
  Listen will be polling for changes. Learn more at "..."
>>> Change detected to: scss/front-page.scss
      write front-page.css
      write front-page.css.map
>>> Change detected to: scss/front-page.scss
>>> Change detected to: scss/front-page.scss

In summary, it creates the file, it detects changes, but doesn't update the CSS file.

Community
  • 1
  • 1
aaronb
  • 162
  • 3
  • 12
  • Checked all the file permissions? Is it valid CSS? Does the `sass` file generate valid CSS files? Use the CLI `sass` utility. – Ryan Vincent Jul 24 '15 at 20:36
  • @RyanVincent Everything is valid--it just doesn't output anything new after the first creation. I've tried to set the file permissions to 777 but that doesn't seem to do anything. – aaronb Jul 24 '15 at 20:41
  • I too see this same behaviour. It seems to update with larger changes, yet ignore smaller ones at times. I'm not finding a clear pattern as of yet. Sometimes it rewrites the .css other times, it just notes that the .scss changed. – EFH Sep 21 '15 at 15:34

5 Answers5

1

It seems something gets corrupted in SCSS's cache which makes it impossible for SCSS to properly compile the output.

This issue is resolved by deleting the .sass-cache directory in the folder where you run the command.

Hampus Nilsson
  • 6,692
  • 1
  • 25
  • 29
0

In my case, I wasn't importing the .scss files for a page into the main file that compiles styles for the project. So even though the listener was picking it up, it had no reason to include into the compilation, and that was just a detail that I had missed.

0

I have had the same issue but what I have gotten to know is that when you have typos in your sass code the Live sass Compile won't update the css file. So what i did i created a new sass file and copied and pasted snippets of my code to check where the bug could be and the issue was fixed.

0

Most probably the syntax is wrong. Please check if the path is correct. In your case scss must be in the same level of the package.json file.

-4

This is my first contribution! lol. I'm assuming this is in the terminal. Make sure you are running sass in the folder you want to work with. Then, you write your command sass --watch front-page.scss:front-page.css take out the "scss"

ken
  • 286
  • 1
  • 5
  • 13
  • 3
    If the OP was in the wrong directory or had the wrong path to the files/directories, Sass would raise an error stating that the files don't exist. – cimmanon Jul 24 '15 at 20:39