Jekyll build error due to name conflict
evanwill opened this issue · comments
The recent v3.0.0 release causes some unexpected issues with many existing Jekyll projects because it causes a build failure when the root scss file has the same base name as one of the sass partials it imports.
For example:
a partial "_sass/_custom.scss" and a main css file "assets/css/custom.scss" that includes @import "custom";
.
With Ruby 3.1, Jekyll 4.3.1, and jekyll-sass-converter 3.0.0, results in fatal error, saying
Conversion error: Jekyll::Converters::Scss encountered an error while converting 'assets/css/custom.scss': expected "{".
Renaming one of the files solves the issue. Or adding to the Gemfile to use an older version, like gem "jekyll-sass-converter", "< 3.0"
.
This arrangement of files worked in previous versions of jekyll-sass-converter and the error message was a bit mysterious, so it took a while for me to debug older projects--I am not sure if this is something that should be fixed, but wanted to bring it up since I think others will be impacted.
3.x is a breaking major release and this is already documented: https://github.com/jekyll/jekyll-sass-converter#dropped-support-of-importing-files-with-the-same-filename-as-their-parent-file
Okay, Thank you!
I didn't understand that at first. I guess didn't really think of "custom.scss" and "_custom.scss" as the same filename, but they end up being the same in the generator's view of things.