How can I solve Sass 'Error: expected more input' - sass

I'm pretty new to Sass. I'm using version 1.13.0 on a Mac. I'm currently using SCSS on a major project for the first time and I've run into an error I've never seen before. I entered sass --watch style.scss style.css into Terminal, as I've done many times in this project without issue. Today however, when I saved my .scss file, Sass deleted my .css file and gave me the following error:
Error: expected more input.
^
style.scss 197:1 root stylesheet
Sass is watching for changes. Press Ctrl-C to stop.
Line 197 is the last line in my stylesheet.
Style.scss and style.css.map remain intact.
I've tried clearing Terminal, quitting and restarting Terminal, and using the standard sass style.scss style.css command but that also returned the same error.
Any help? Apologies if I'm leaving out any info. As I mentioned earlier, I'm very new to Sass so please let me know if there's anything else I can clarify.

It turns out my .scss file ended in a commend that I had forgotten to close off (I had forgotten to add the final slash in a /*comment*/). This was causing the error. Once I closed off the comment, everything went back to working properly.

Related

Sass --watch keeps compiling the file

I've been unable to find something similar to this on a Google search, but using VSCode and Dart Sass (now v 1.23.1) and running sass --watch css the file keeps on saving/compiling
There seemed to be no issue earlier today. However, the version I was running was 1.21. (I updated Sass to use the new module spec)
What is happening?
The file main.scss is saved
Terminal displays Compiled css/main.scss to css/main.css
It then loops, printing the following
Compiled css/main.css to css/main.css
Things I have tried
Uninstalled and reinstalled sass
deleted map files and related compiled files
Aprart from that, I am at a loss of what to try next. Has anyone experienced similar to this and what did they do to resolve it?
It seems this has been reported as a bug in the Dart-Sass repository and a pull request has been opened.

sass not working. scss file changes are not applying to css

I have set up Sass and created a project it was worked nicely but after restarting my computer, Now if I change, add or remove anything from my style.scss file it does not affect the style.css Before restarting it was functional and worked nicely.
Are you using command line to watch your SaSS file and compile your CSS? If so you may want to run your “—watch” command again.

Why isn't my SASS watch command working?

Attempting on a Mac with the latest version of Yosemite
I'm using the latest version of sass to refactor my site. I'm setting up watch command via the command line. my directory setup has a scss folder with the main css stylesheet cloned as .scss. and no css folder.
When I attempt the sass --watch scss:css command while in the main project directory folder, I've been told that, if there isn't one present, a css folder should be generated and a cloned .css file should be created along with a map file. Command line tells me >>> Sass is watching for changes. Press Ctrl-C to stop. however, changes are not being recorded.
I've tried updating my gems and uninstalling/ reinstalling sass, but nothing seems to be working.
Just tried this - the css folder doesn't get autogenerated. You need to generate it yourself. From there on, you should be good to go.
So if you are in the main project folder with subfolders called scss and css and you have, for example, a main.scss file in the scss directory, you can run the command exactly as you specified and everything should work as specified.

Inconsident indentation with SCSS in webstorm file watcher

I am using Webstorm file watcher to transpile my .scss file in to a .css file. Whenever the process runs, it gives me an error
error main.css (Line 37: Inconsistent indentation: 2 spaces were used for indentation, but the rest of the document was indented using 8 spaces.)
I have seen this happen to others through some google searching but none of their solutions seem to help me. And as far as I am aware, scss shouldn't complain about indentation.
Here are my file watcher settings
You probably solved it by now, but I recently had the same error (same line number and everything). To help others who run into the same problem.
your 'arguments' are wrong.
you are telling the compiler to compile the .css file (to nowhere).
change it into:
--no-cache --update $fileName$:$fileNameWithoutExtension$.css

#import "breakpoint"; throws not found error

I was working on this project yesterday using Sass and Breakpoint and everything was fine. This morning however when I went to compile using sass --watch .. I am getting this error:
error ../sass/screen.scss (Line 6: File to import not found or unreadable: breakpoint.
Load path: /Users/MOD3/Sites/GABE/stylesheets/stylesheets)
I am not sure why it is not finding breakpoint anymore but I am sure it is installed. I read something about it needing to be an absolute path, but where do I get that path from? Any idea how to fix this? It was working yesterday...
Breakpoint currently does not work with vanilla Sass as it requires a small bit of Ruby that is not available until Sass 3.3. My intuition is that you probably ran sass --compass --watch to allow Breakpoint to run through Compass. If not, I would highly encourage you to compile through Compass or Breakpoint will not work as expected.
UPDATE:
Issue was solved by running compass watch from same folder as config.rb.

Resources