-
DescriptionFollowed the setup steps but getting syntax errors on the sass file. I've created a very minimal project setup but still can't get it to work. Steps to reproduce
You can also clone this repo: Expected resultShould compile the .sass file and the styles be applied. Actual resultGet an error:
Environment
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Hi! You're trying to use a package there that has been deprecated and hasn't been updated in 3 years. You'll want to use https://github.com/csstools/postcss-preset-env and set the correct options to enable your specific syntax. The error is is about the missing semicolon, so you'll need to change the preset options to support that syntax. |
Beta Was this translation helpful? Give feedback.
-
@LekoArts, Thanks for the quick response! Sorry, I should have cleaned up better, I completely removed that package and I'm still getting the same issue. I've updated the above with the new commit diff, codebox, and environment info. While debugging I also found that if I do the following changes it will work fine at the expense of not being able to change the precision: diff --git a/gatsby-config.js b/gatsby-config.js
index e3ef768..62a05c7 100644
--- a/gatsby-config.js
+++ b/gatsby-config.js
@@ -12,14 +12,7 @@ module.exports = {
},
},
plugins: [
- {
- resolve: `gatsby-plugin-sass`,
- options: {
- sassOptions: {
- precision: 8,
- }
- },
- },
+ `gatsby-plugin-sass`,
`gatsby-plugin-image`,
{
resolve: `gatsby-source-filesystem`,
|
Beta Was this translation helpful? Give feedback.
-
I think If you add that as an option it should work. |
Beta Was this translation helpful? Give feedback.
-
Sass options breaking changes! You need to add From (example): {
resolve: 'gatsby-plugin-sass',
options: {
data: `@import "src/styles/main";`,
includePaths: [
'src/components',
],
},
}, to {
resolve: 'gatsby-plugin-sass',
options: {
sassOptions {
data: `@import "src/styles/main";`,
includePaths: [
'src/components',
],
}
},
}, |
Beta Was this translation helpful? Give feedback.
I think
sass-loader
isn't handling settingindentedSyntax
correctly when adding options. https://github.com/webpack-contrib/sass-loader#sassoptionsIf you add that as an option it should work.