Home >Web Front-end >CSS Tutorial >What Causes the 'Expected Expression' Error in Sass and How to Fix It?
Troubleshooting Semantic Sass Syntax Error: "Expected Expression"
While attempting to learn Sass, you may encounter an error message stating "expected expression" when compiling your Sass file. Despite being confident in the validity of your CSS, the terminal may deem it invalid. Let's investigate the potential cause and provide a solution.
Problem:
error sass/test.sass (Line 3: Invalid CSS after "80%": expected expression (e.g. 1px, bold), was ";")
Potential Cause:
The error indicates an issue with your Sass file syntax. Semantically (or SCSS) authored Sass files differ from indented Sass (or .sass) files. You appear to be using the .sass extension but may have written SCSS code.
Solution:
To resolve this issue, ensure that your file follows the correct syntax for the given extension. In your case, change the file name to style.scss and confirm that your code adheres to Semantically authored Sass syntax.
The above is the detailed content of What Causes the 'Expected Expression' Error in Sass and How to Fix It?. For more information, please follow other related articles on the PHP Chinese website!