jekyll / jekyll-sass-converter

A Sass converter for Jekyll.

Home Page:http://rubygems.org/gems/jekyll-sass-converter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Jekyll::Converters::Scss encountered an error while converting 'assets/css/custom.scss'

d9beuD opened this issue · comments

Hello, I'm building a site with Jekyll 4.3.2 and ruby 3.1.3. For my site stylesheets, I want to import SCSS files.

Following the Assets documentation page, I created the file assets/css/custom.scss which imports a partial _sass/custom.scss.

---
---

@import "custom";

When I try to run Jekyll with bundle exec jekyll serve -H localhost -l -I, I got the following error:

      Generating... 
Error: expected "{".
  ╷
4 │ @import "custom";
  │                 ^
  ╵
  path/to/assets/css/custom.scss 4:17  @import
  path/to/assets/css/custom.scss 1:9   root stylesheet 
  Conversion error: Jekyll::Converters::Scss encountered an error while converting 'assets/css/custom.scss':
                    expected "{".
                    ------------------------------------------------
      Jekyll 4.3.2   Please append `--trace` to the `serve` command 
                     for any additional information or backtrace. 
                    ------------------------------------------------

You can inspect my project's current state here.

I think there is something I'm missing but I can't find what. Can you help me please?

This is an expected behavior with jekyll-sass-converter-3.0.0 and newer.
The converter no longer supports a parent template to @import a partial with same name as the parent.

You have two options. Either rename one of the files or lock to an older version of this converter with following in the Gemfile:

gem "jekyll-sass-converter", "~> 2.0"

Thank you. I renamed my parent templates and it works now!