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

SCSS build error for GitHub Pages #131

Closed
DaveSkender opened this issue Jul 23, 2021 · 13 comments
Closed

SCSS build error for GitHub Pages #131

DaveSkender opened this issue Jul 23, 2021 · 13 comments

Comments

@DaveSkender
Copy link

DaveSkender commented Jul 23, 2021

I can't tell if this is Cayman template specific, but am getting errors in my GitHub Pages build about this template.

GitHub Pages failed to build your site.
Your SCSS file assets/css/style.scss has an error on line 3: File to import not found or unreadable: cayman. 
Load path: /tmp/jekyll-remote-theme-20210723-7-m9rhj/_sass.

When I try to build locally:

Configuration file: C:/Users/../_config.yml
jekyll 3.9.0 | Error: The jekyll-theme-cayman theme could not be found.
@blackstarzes
Copy link

I'm getting the same issue. It looks like this repo is failing at cd47cc1.

@DaveSkender
Copy link
Author

DaveSkender commented Jul 24, 2021

I think this has more to do with a recent github-pages merge from @parkr that bumps it to version 216. This may occur when you do a bundle update and it is updated in your GemFile.lock file.

If I force it back to version 215 in my GemFile it seems to work okay locally, but I'm still getting GitHub Pages build failure.

gem 'github-pages', "~>215"

blackstarzes added a commit to veelourenco/veelourenco.github.io that referenced this issue Jul 24, 2021
Until pages-themes/cayman#131 is resolved, we need to disable jekyll:
- Added a .nojekyll file to the root
- Removed _site from .gitignore
- Checked in built _site files
@blackstarzes
Copy link

Hmmm... no that still didn't work for me - I get the same error in build. I am just going to disable Jekyll and serve a static site until this is resolved.

@joolfe
Copy link

joolfe commented Jul 24, 2021

Same error in my repo, any clues about what happen?

@blackstarzes
Copy link

So pinning github-pages to 215 worked locally, but not when running on GitHub. I ended up moving the theme's scss files to my repo, which led to some yak-shaving to see how much of the theme I actually used, and subsequent removal of the theme dependency. Sorry if that doesn't help you 😅.

@AnonyPla
Copy link

See #130 (comment)

@joolfe
Copy link

joolfe commented Jul 24, 2021

For me the solution proposed in #130 works, just replace

´@import "{{ site.theme }}";´

to

´@import 'jekyll-theme-cayman';´

@Jmuccigr
Copy link

Jmuccigr commented Jul 24, 2021

Yes, this works for me too with the minimal theme, but it's more a work-around than a fix, no? The theme should be import-able from the config file without hardcoding it into the scss.

PS Also still confused about what broke here.

@DaveSkender
Copy link
Author

DaveSkender commented Jul 24, 2021

I think this is related to an update to the GitHub Pages theme manager (see my comment above). If you look at their merged PR from yesterday, they move from Gem-based to remote-based theme management.

I believe the recently updated github-pages v216 introduces either a bug or at least a breaking change; and reverting to v215 does not seem to help because the GitHub Pages build likely only uses the latest version.

My observation on the bug/breaking change is that bundle update will set github-pages to version 216 and jekyll-theme-cayman is removed from the GemFile.lock dependencies list -- it's basically not included as a sub-dependency Gem anymore.

@DaveSkender
Copy link
Author

DaveSkender commented Jul 24, 2021

To get this to work locally (and with publish), here's my workflow:

# remove old artifacts
bundle exec jekyll clean
# leave this in your _config.yml
theme: jekyll-theme-cayman
# as mentioned in recommendation above
# add explicit include in your custom assets/css/style.scss file
# replace @import "{{ site.theme }}"; with
@import "jekyll-theme-cayman";
# add theme as an explicit jekyll plugin to GemFile
# do not just cmd line `gem install jekyll-theme-cayman`
group :jekyll_plugins do
  gem 'github-pages'
  gem 'jekyll-theme-cayman'
end
# load site locally, to test
bundle install
bundle update #optional
bundle exec jekyll serve

@Jmuccigr
Copy link

My observation on the bug is that bundle update will set github-pages to version 216 and jekyll-theme-cayman is removed from the GemFile.lock dependencies list -- it's basically not included as a sub-dependency Gem anymore.

Well, my Gemfile.lock includes both cayman and minimal, even after the bundle update github-pages which moved me to 216. I have to admit that I don't quite understand what's going on here when jekyll says it can't find the theme file when it's there.

In any case, that update seems like it broke things for a lot of people. It also seems to have some code to try to convert themes to remote themes which I guess didn't work (or isn't supposed to do what I think). Not a great experience in any case.

@AnonyPla
Copy link

I tried reverting to 215 just to see but it didn't help ... anyway ... my fix #130 (comment) and this one #131 (comment) work so we have a workaround

@parkr
Copy link

parkr commented Jul 28, 2021

File to import not found or unreadable: cayman

This should now be fixed on GitHub Pages and in the GitHub-pages gem locally.

jekyll 3.9.0 | Error: The jekyll-theme-cayman theme could not be found.

I'm really sorry about this, but this slipped past our testing. I have added an upgrading note to v216 and v217 of the github-pages gem, e.g. https://github.com/github/pages-gem/releases/tag/v217.

@parkr parkr closed this as completed Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants