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

Undefined variable: $feedback-color on line 156 (of assets/css/just-the-docs-dark.scss) #502

Closed
al-the-x opened this issue Dec 4, 2020 · 6 comments

Comments

@al-the-x
Copy link

al-the-x commented Dec 4, 2020

I have a recent install of a documentation site that is using just-the-docs that emits this error on build. In #372, @SgtSilvio told the OP:

You have copied the _sass and assets folders of just-the-docs to your repository.
If you use just-the-docs as a remote theme (remote_theme: pmarsceill/just-the-docs in _config.yml) these files are provided by the theme.
Please delete the _sass and assets folders except your own files in it (like assets/js/404.js).

There is no _sass or assets folder in the repo. There are nothing but Markdown and HTML files in the repo. The Gemfile contains a gem specification for the theme, and I have installed the deps via bundle install under Ruby 2.6.2. The _config.yml contains:

remote_theme: pmarsceill/just-the-docs
theme: "just-the-docs"
color_scheme: dark

Running bundle exec jekyll build --trace produces:

Configuration file: ~/Projects/[REDACTED]/_config.yml
            Source: ~/Projects/[REDACTED]
       Destination: ~/Projects/[REDACTED]/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
Invalid theme folder: _sass
      Remote Theme: Using theme pmarsceill/just-the-docs
       Jekyll Feed: Generating feed for posts
  Conversion error: Jekyll::Converters::Scss encountered an error while converting 'assets/css/just-the-docs-dark.scss':
                    Undefined variable: "$feedback-color". on line 156
bundler: failed to load command: jekyll (~/.rbenv/versions/2.6.2/bin/jekyll)
Jekyll::Converters::Scss::SyntaxError: Undefined variable: "$feedback-color". on line 156
  ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/jekyll-sass-converter-1.5.2/lib/jekyll/converters/scss.rb:123:in `rescue in convert'
  ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/jekyll-sass-converter-1.5.2/lib/jekyll/converters/scss.rb:118:in `convert'
  ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/renderer.rb:101:in `block in convert'
  ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/renderer.rb:99:in `each'
  ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/renderer.rb:99:in `reduce'
  ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/renderer.rb:99:in `convert'
  ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/renderer.rb:83:in `render_document'
  ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/renderer.rb:62:in `run'
  ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/site.rb:479:in `render_regenerated'
  ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/site.rb:472:in `block in render_pages'
  ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/site.rb:471:in `each'
  ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/site.rb:471:in `render_pages'
  ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/site.rb:192:in `render'
  ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/site.rb:71:in `process'
  ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/command.rb:28:in `process_site'
  ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/commands/build.rb:65:in `build'
  ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/commands/build.rb:36:in `process'
  ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
  ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
  ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
  ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
  ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
  ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
  ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/exe/jekyll:15:in `<top (required)>'
  ~/.rbenv/versions/2.6.2/bin/jekyll:23:in `load'
  ~/.rbenv/versions/2.6.2/bin/jekyll:23:in `<top (required)>'

What am I doing wrong?

@al-the-x
Copy link
Author

al-the-x commented Dec 4, 2020

Worth noting that

  • The repo is private, otherwise I would share a link.
  • The site built correctly in GitHub Pages on the last push to master back in August.
  • The Gemfile spec for just-the-docs is ~> 0.2.7

@pdmosses
Copy link
Contributor

pdmosses commented Dec 5, 2020

@al-the-x I haven't been able to replicate this issue.

Could you confirm that you've run bundle update, and that it reports Using just-the-docs 0.2.9?

@al-the-x
Copy link
Author

al-the-x commented Dec 7, 2020

Output from bundle install under Ruby 2.7 indicates just-the-docs at 0.2.7 currently. The Gemfile is requesting just-the-docs at or above 0.2.7 with ~>, which should get the bump to 0.2.9, correct?

I'll try upgrading via Bundler real quick, but any reason that the previous good build version would have broken that you know of?

Gemfile
source "https://rubygems.org"

# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
#     bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
# gem "jekyll", "~> 3.8.6"

# This is the default theme for new Jekyll sites. You may change this to anything you like.
# gem "minima", "~> 2.0"
gem "just-the-docs", "~> 0.2.7"

# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
gem "github-pages", group: :jekyll_plugins

# If you have any plugins, put them here!
group :jekyll_plugins do
  gem "jekyll-feed", "~> 0.6"
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
install_if -> { RUBY_PLATFORM =~ %r!mingw|mswin|java! } do
  gem "tzinfo", "~> 1.2"
  gem "tzinfo-data"
end

# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.0", :install_if => Gem.win_platform?
bundle install
$ bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching rake 12.3.3
Installing rake 12.3.3
Fetching concurrent-ruby 1.1.6
Installing concurrent-ruby 1.1.6
Fetching i18n 0.9.5
Installing i18n 0.9.5
Fetching minitest 5.14.0
Installing minitest 5.14.0
Fetching thread_safe 0.3.6
Installing thread_safe 0.3.6
Fetching tzinfo 1.2.6
Installing tzinfo 1.2.6
Fetching activesupport 5.2.4.1
Installing activesupport 5.2.4.1
Fetching public_suffix 3.1.1
Installing public_suffix 3.1.1
Fetching addressable 2.7.0
Installing addressable 2.7.0
Using bundler 2.1.4
Fetching coffee-script-source 1.11.1
Installing coffee-script-source 1.11.1
Fetching execjs 2.7.0
Installing execjs 2.7.0
Fetching coffee-script 2.4.1
Installing coffee-script 2.4.1
Fetching colorator 1.1.0
Installing colorator 1.1.0
Fetching ruby-enum 0.7.2
Installing ruby-enum 0.7.2
Fetching commonmarker 0.17.13
Installing commonmarker 0.17.13 with native extensions
Fetching dnsruby 1.61.3
Installing dnsruby 1.61.3
Fetching eventmachine 1.2.7
Installing eventmachine 1.2.7 with native extensions
Fetching http_parser.rb 0.6.0
Installing http_parser.rb 0.6.0 with native extensions
Fetching em-websocket 0.5.1
Installing em-websocket 0.5.1
Fetching ffi 1.12.2
Installing ffi 1.12.2 with native extensions
Fetching ethon 0.12.0
Installing ethon 0.12.0
Fetching multipart-post 2.1.1
Installing multipart-post 2.1.1
Fetching faraday 1.0.0
Installing faraday 1.0.0
Fetching forwardable-extended 2.6.0
Installing forwardable-extended 2.6.0
Fetching gemoji 3.0.1
Installing gemoji 3.0.1
Fetching sawyer 0.8.2
Installing sawyer 0.8.2
Fetching octokit 4.16.0
Installing octokit 4.16.0
Fetching typhoeus 1.3.1
Installing typhoeus 1.3.1
Fetching github-pages-health-check 1.16.1
Installing github-pages-health-check 1.16.1
Fetching rb-fsevent 0.10.3
Installing rb-fsevent 0.10.3
Fetching rb-inotify 0.10.1
Installing rb-inotify 0.10.1
Fetching sass-listen 4.0.0
Installing sass-listen 4.0.0
Fetching sass 3.7.4
Installing sass 3.7.4
Fetching jekyll-sass-converter 1.5.2
Installing jekyll-sass-converter 1.5.2
Fetching listen 3.2.1
Installing listen 3.2.1
Fetching jekyll-watch 2.2.1
Installing jekyll-watch 2.2.1
Fetching kramdown 1.17.0
Installing kramdown 1.17.0
Fetching liquid 4.0.3
Installing liquid 4.0.3
Fetching mercenary 0.3.6
Installing mercenary 0.3.6
Fetching pathutil 0.16.2
Installing pathutil 0.16.2
Fetching rouge 3.13.0
Installing rouge 3.13.0
Fetching safe_yaml 1.0.5
Installing safe_yaml 1.0.5
Fetching jekyll 3.8.5
Installing jekyll 3.8.5
Fetching jekyll-avatar 0.7.0
Installing jekyll-avatar 0.7.0
Fetching jekyll-coffeescript 1.1.1
Installing jekyll-coffeescript 1.1.1
Fetching jekyll-commonmark 1.3.1
Installing jekyll-commonmark 1.3.1
Fetching jekyll-commonmark-ghpages 0.1.6
Installing jekyll-commonmark-ghpages 0.1.6
Fetching jekyll-default-layout 0.1.4
Installing jekyll-default-layout 0.1.4
Fetching jekyll-feed 0.13.0
Installing jekyll-feed 0.13.0
Fetching jekyll-gist 1.5.0
Installing jekyll-gist 1.5.0
Fetching jekyll-github-metadata 2.13.0
Installing jekyll-github-metadata 2.13.0
Fetching mini_portile2 2.4.0
Installing mini_portile2 2.4.0
Fetching nokogiri 1.10.8
Installing nokogiri 1.10.8 with native extensions
Fetching html-pipeline 2.12.3
Installing html-pipeline 2.12.3
Fetching jekyll-mentions 1.5.1
Installing jekyll-mentions 1.5.1
Fetching jekyll-optional-front-matter 0.3.2
Installing jekyll-optional-front-matter 0.3.2
Fetching jekyll-paginate 1.1.0
Installing jekyll-paginate 1.1.0
Fetching jekyll-readme-index 0.3.0
Installing jekyll-readme-index 0.3.0
Fetching jekyll-redirect-from 0.15.0
Installing jekyll-redirect-from 0.15.0
Fetching jekyll-relative-links 0.6.1
Installing jekyll-relative-links 0.6.1
Fetching rubyzip 1.3.0
Installing rubyzip 1.3.0
Fetching jekyll-remote-theme 0.4.1
Installing jekyll-remote-theme 0.4.1
Fetching jekyll-seo-tag 2.6.1
Installing jekyll-seo-tag 2.6.1
Fetching jekyll-sitemap 1.4.0
Installing jekyll-sitemap 1.4.0
Fetching jekyll-swiss 1.0.0
Installing jekyll-swiss 1.0.0
Fetching jekyll-theme-architect 0.1.1
Installing jekyll-theme-architect 0.1.1
Fetching jekyll-theme-cayman 0.1.1
Installing jekyll-theme-cayman 0.1.1
Fetching jekyll-theme-dinky 0.1.1
Installing jekyll-theme-dinky 0.1.1
Fetching jekyll-theme-hacker 0.1.1
Installing jekyll-theme-hacker 0.1.1
Fetching jekyll-theme-leap-day 0.1.1
Installing jekyll-theme-leap-day 0.1.1
Fetching jekyll-theme-merlot 0.1.1
Installing jekyll-theme-merlot 0.1.1
Fetching jekyll-theme-midnight 0.1.1
Installing jekyll-theme-midnight 0.1.1
Fetching jekyll-theme-minimal 0.1.1
Installing jekyll-theme-minimal 0.1.1
Fetching jekyll-theme-modernist 0.1.1
Installing jekyll-theme-modernist 0.1.1
Fetching jekyll-theme-primer 0.5.4
Installing jekyll-theme-primer 0.5.4
Fetching jekyll-theme-slate 0.1.1
Installing jekyll-theme-slate 0.1.1
Fetching jekyll-theme-tactile 0.1.1
Installing jekyll-theme-tactile 0.1.1
Fetching jekyll-theme-time-machine 0.1.1
Installing jekyll-theme-time-machine 0.1.1
Fetching jekyll-titles-from-headings 0.5.3
Installing jekyll-titles-from-headings 0.5.3
Fetching jemoji 0.11.1
Installing jemoji 0.11.1
Fetching minima 2.5.1
Installing minima 2.5.1
Fetching unicode-display_width 1.6.1
Installing unicode-display_width 1.6.1
Fetching terminal-table 1.8.0
Installing terminal-table 1.8.0
Fetching github-pages 204
Installing github-pages 204
Fetching just-the-docs 0.2.7
Installing just-the-docs 0.2.7
Bundle complete! 6 Gemfile dependencies, 86 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Post-install message from dnsruby:
Installing dnsruby...
  For issues and source code: https://github.com/alexdalitz/dnsruby
  For general discussion (please tell us how you use dnsruby): https://groups.google.com/forum/#!forum/dnsruby
Post-install message from sass:

Ruby Sass has reached end-of-life and should no longer be used.

* If you use Sass as a command-line tool, we recommend using Dart Sass, the new
  primary implementation: https://sass-lang.com/install

* If you use Sass as a plug-in for a Ruby web framework, we recommend using the
  sassc gem: https://github.com/sass/sassc-ruby#readme

* For more details, please refer to the Sass blog:
  https://sass-lang.com/blog/posts/7828841

Post-install message from html-pipeline:
-------------------------------------------------
Thank you for installing html-pipeline!
You must bundle Filter gem dependencies.
See html-pipeline README.md for more details.
https://github.com/jch/html-pipeline#dependencies
-------------------------------------------------

@pdmosses
Copy link
Contributor

pdmosses commented Dec 7, 2020

My suspicion is that Jekyll interprets your Gemfile and _config.yml as referring to different versions of the theme, and one of them uses a variable that is missing in the other. Unfortunately, I know very little about how theme versions work with gems...

To get v0.2.9, try using bundle update instead of bundle install.

You might also try removing the theme directive from _config.yml, and using:

remote_theme: pmarsceill/just-the-docs@v0.2.7

@al-the-x
Copy link
Author

al-the-x commented Dec 7, 2020

I performed a bundle update just-the-docs and got the version up to 0.2.9 as you suggested. I got a swarm of warnings in the console when I build, although the theme did build:

~/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/jekyll-3.8.5/lib/jekyll/tags/include.rb:194: warning: Using the last argument as keyword parameters is deprecated

The site looked broken, though, with too-big icons for the heading links and some minor layout bugs. I tried restarting and building manually, as well. I also attempted to pin the version of the theme in the remote_theme directive as you suggested. Pinning to 0.2.9 as specified in the Gemfile after the update got the site looking correctly. I tried again with a clean bundle with 0.2.7 with and without the version in remote_theme and was able to repeat the $feedback-color error without the tag and repairing it by applying the tag.

It does appear that Jekyll does something funny with remote_theme, and the version in the Gemfile needs to match the version tagged on remote_theme or else Bad Things™️ can happen. In my case, the remote_theme was untagged and likely pulling the latest version, although where it was pulling and storing that version, I don't know. There was no just-the-docs@0.2.9 installed in gem list until I updated it via Bundler. I can pin them both back to 0.2.7 and rebuild with no problems, but if I omit the tag on remote_theme and pin the theme gem to 0.2.7, the theme fails to build again.

The diff between 0.2.7 and 0.2.9 is pretty significant. I'll recommend a patch to pin the versions and make them match... and upgrade to 0.3.x while I'm at it. Thanks for the suggestions and thanks for the theme!

@al-the-x al-the-x closed this as completed Dec 7, 2020
@SirLich
Copy link

SirLich commented Dec 26, 2020

The site looked broken, though, with too-big icons for the heading links and some minor layout bugs.

For anyone who runs across this in the future, this is most likely a CSS caching issue. I would suggest trying in Incognito mode to see if it looks better. If so, you just need to wait for the cache to update, or manually clear it.

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

3 participants