Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Invalid CSS after " @if meta": expected "{", was ".function-exist..." on line 72 #177

Open
NaA-hwang opened this issue Dec 16, 2024 · 7 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@NaA-hwang
Copy link

NaA-hwang commented Dec 16, 2024

Once I push my project and my project starts github actions, it faces this error below.

 Conversion error: Jekyll::Converters::Scss encountered an error while converting 'assets/css/main.scss':
jekyll 3.10.0 | Error:  Invalid CSS after "  @if meta": expected "{", was ".function-exist..." on line 72
                    Invalid CSS after " @if meta": expected "{", was ".function-exist..." on line 72
/github/workspace/vendor/bundle/ruby/3.2.0/gems/jekyll-sass-converter-1.5.2/lib/jekyll/converters/scss.rb:123:in `rescue in convert': Invalid CSS after "  @if meta": expected "{", was ".function-exist..." on line 72 (Jekyll::Converters::Scss::SyntaxError)
        raise SyntaxError, "#{e} on line #{e.sass_line}"
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I read the comment recommending upgrade of jekyll and tried it by adding gem "jekyll", "~> 4.3.4" and gem "jekyll-sass-converter", "~> 3.0.0" on Gemfile. But once I command bundle update jekyll jekyll-sass-converter on my local environment, it shows this error below.

Could not find compatible versions

Because github-pages < 9 depends on kramdown = 1.0.2
  and github-pages >= 9, < 14 depends on kramdown = 1.2.0,
  github-pages < 14 requires kramdown = 1.0.2 OR = 1.2.0.
And because github-pages >= 14, < 32 depends on kramdown = 1.3.1
  and jekyll >= 4.3.0 depends on kramdown >= 2.3.1, < 3.A,
  jekyll >= 4.3.0 is incompatible with github-pages < 32.
And because github-pages >= 117, < 178 depends on jekyll-sass-converter = 1.5.0
  and github-pages >= 39, < 117 depends on jekyll-sass-converter = 1.3.0,
  if jekyll >= 4.3.0 and github-pages < 32 OR >= 39, < 178 then jekyll-sass-converter = 1.3.0 OR = 1.5.0.
And because github-pages >= 22, < 39 depends on jekyll-sass-converter = 1.2.0
  and github-pages >= 178 depends on jekyll-sass-converter = 1.5.2,
  jekyll >= 4.3.0 requires jekyll-sass-converter = 1.2.0 OR = 1.3.0 OR = 1.5.0 OR = 1.5.2.
So, because Gemfile depends on jekyll ~> 4.3.4
  and Gemfile depends on jekyll-sass-converter ~> 3.0.0,
  version solving has failed.

It seems like the problem of Github pages dependency. This page shows the dependency versions Github Pages uses. How do we get to use jekyll version 4.x.x while the github pages dependency only supports jekyll version 3.10.0?

here is my actions log: build_and_deploy log

@jeffreytse jeffreytse self-assigned this Dec 20, 2024
@jeffreytse jeffreytse added the bug Something isn't working label Dec 20, 2024
@jeffreytse
Copy link
Owner

jeffreytse commented Dec 20, 2024

@NaA-hwang As the github-pages gem requires the Jekyll 3.X.X version, I've updated the instructions for using remote theme. please refer to here, and then update your dependencies by bundle update.

@jeffreytse jeffreytse added the good first issue Good for newcomers label Dec 20, 2024
@NaA-hwang
Copy link
Author

NaA-hwang commented Dec 23, 2024

@jeffreytse My project installed yat theme by forking the whole repository. But I tried using remote theme on my new project(whole different repository) but it still shows the same Conversion error

Here is the log with the error.

@jeffreytse
Copy link
Owner

jeffreytse commented Dec 23, 2024

@NaA-hwang I saw your logs, it's still using the jekyll-sass-converter-1.5.2, not a new version, it looks like some kind of cache, could you please try this jekyll-deploy-action instead.

Or you can try to add gem "jekyll-sass-converter", "~> 3.0" to your Gemfile to see it works or not.

@NaA-hwang
Copy link
Author

@jeffreytse First of all, thank you for your kind instructions and sorry for these endless errors that i am bringing in :'(

First thing I did was substituting the workflow file with the jekyll-deploy-action you introduced. I tried this on my first project where I forked your yat theme to. As a result, again, it shows the same Conversion error. logs are here

Secondly, I tried to add gem "jekyll-sass-converter", "~> 3.0" to my Gemfile but what it tells me is below. (I brought only a few lines from the entire error message)
Could not find compatible versions
Because github-pages >= 178 depends on jekyll-sass-converter = 1.5.2
and github-pages >= 117, < 178 depends on jekyll-sass-converter = 1.5.0,
github-pages >= 117 requires jekyll-sass-converter = 1.5.0 OR = 1.5.2.
And because github-pages >= 44, < 147 depends on liquid = 3.0.6,
github-pages >= 44 requires jekyll-sass-converter = 1.5.0 OR = 1.5.2 or liquid = 3.0.6.

I feel sorry to bother you with this problem but I am deseprately desiring this theme. I like the color, the layout, every features in this theme. I am just hoping to be able to use this theme eventually..

@jeffreytse
Copy link
Owner

@NaA-hwang Don't forget to remove thisgem "github-pages", group: :jekyll_plugins in your Gemfile as it depends on github-pages gem

@NaA-hwang
Copy link
Author

I made it! Since my repository is messed up with so many googling, I re-cloned your repository and removed Gemfile.lock from my github repository. For those of you who have never used ruby or jekyll like me, don't forget to set deployment branch to gh-pages in Settings.
Thank you for your comments and beautiful theme, @jeffreytse!

@jeffreytse
Copy link
Owner

@NaA-hwang Congrats! It's good news that you made it. Welcome to star this project for further updates in the future. : )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants