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

"Error: unterminated attribute selector..." when using tailwindcss/typography v0.4.1

asimpletune opened this issue · comments

Hi there, I'm running into this issue when trying to do a fresh build of Jekyll + tailwind + posts. I'm not super familiar with a lot of front end tooling, so please bear with me and I'll do my best to explain the issue I'm seeing.

Versioning info and setup

Gemfile version info:

gem "jekyll", "~> 4.2.0"
group :jekyll_plugins do
  gem 'jekyll-postcss', "~> 0.4.1"
end

Relevant package.json info:

"devDependencies": {
  "@tailwindcss/typography": "^0.4.1",
  "autoprefixer": "^10.2.6",
  "cssnano": "^5.0.6",
  "postcss": "^8.3.5",
  "postcss-import": "^14.0.2",
  "tailwindcss": "^2.2.4"
}

Other than this, everything is pretty standard. This is a freshly generated Jekyll project and I think my postcss/tailwind configs are setup correctly, or at least not exotically. Like I mentioned above, I'm not really familiar with this tooling, so I could totally be doing something obviously wrong without realizing, however nothing really stands out yet.

What I'm seeing

After bundle exec Jekyll build I get the following output:

Conversion error: Jekyll::Converters::Scss encountered an error while converting 'assets/css/style.scss':
Error: unterminated attribute selector for type on line 624:16 of style.scss >> .prose ol[type="A" s] { ---------------^
------------------------------------------------
Jekyll 4.2.0 Please append --trace to the build command
for any additional information or backtrace.
------------------------------------------------

I noticed the css class here is from tailwindcss/typography bundle, so I tried dropping it the version number to 0.31 and the issue went away.

A similar issue was mentioned here tailwindlabs/tailwindcss#4722 (reply in thread) and the maintainer mentioned that the allegedly offending selectors were fine, so I came here first with my issue.

Here's the output from my build with --trace set:

   Conversion error: Jekyll::Converters::Scss encountered an error while converting 'assets/css/style.scss':
                    Error: unterminated attribute selector for type on line 624:16 of style.scss >> .prose ol[type="A" s] { ---------------^ 
bundler: failed to load command: jekyll (/usr/local/lib/ruby/gems/2.6.0/bin/jekyll)
Traceback (most recent call last):
	44: from /usr/local/opt/ruby/bin/bundle:23:in `<main>'
	43: from /usr/local/opt/ruby/bin/bundle:23:in `load'
	42: from /Users/spence/.gem/ruby/2.6.0/gems/bundler-2.2.21/exe/bundle:37:in `<top (required)>'
	41: from /Users/spence/.gem/ruby/2.6.0/gems/bundler-2.2.21/lib/bundler/friendly_errors.rb:128:in `with_friendly_errors'
	40: from /Users/spence/.gem/ruby/2.6.0/gems/bundler-2.2.21/exe/bundle:49:in `block in <top (required)>'
	39: from /Users/spence/.gem/ruby/2.6.0/gems/bundler-2.2.21/lib/bundler/cli.rb:24:in `start'
	38: from /Users/spence/.gem/ruby/2.6.0/gems/bundler-2.2.21/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
	37: from /Users/spence/.gem/ruby/2.6.0/gems/bundler-2.2.21/lib/bundler/cli.rb:30:in `dispatch'
	36: from /Users/spence/.gem/ruby/2.6.0/gems/bundler-2.2.21/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	35: from /Users/spence/.gem/ruby/2.6.0/gems/bundler-2.2.21/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	34: from /Users/spence/.gem/ruby/2.6.0/gems/bundler-2.2.21/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	33: from /Users/spence/.gem/ruby/2.6.0/gems/bundler-2.2.21/lib/bundler/cli.rb:474:in `exec'
	32: from /Users/spence/.gem/ruby/2.6.0/gems/bundler-2.2.21/lib/bundler/cli/exec.rb:28:in `run'
	31: from /Users/spence/.gem/ruby/2.6.0/gems/bundler-2.2.21/lib/bundler/cli/exec.rb:63:in `kernel_load'
	30: from /Users/spence/.gem/ruby/2.6.0/gems/bundler-2.2.21/lib/bundler/cli/exec.rb:63:in `load'
	29: from /usr/local/lib/ruby/gems/2.6.0/bin/jekyll:23:in `<top (required)>'
	28: from /usr/local/lib/ruby/gems/2.6.0/bin/jekyll:23:in `load'
	27: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/exe/jekyll:15:in `<top (required)>'
	26: from /Users/spence/.gem/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
	25: from /Users/spence/.gem/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
	24: from /Users/spence/.gem/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
	23: from /Users/spence/.gem/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
	22: from /Users/spence/.gem/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
	21: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
	20: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
	19: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in `each'
	18: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
	17: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/commands/build.rb:36:in `process'
	16: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/commands/build.rb:65:in `build'
	15: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:28:in `process_site'
	14: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:80:in `process'
	13: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:211:in `render'
	12: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:538:in `render_pages'
	11: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:538:in `each'
	10: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:539:in `block in render_pages'
	 9: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:547:in `render_regenerated'
	 8: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/renderer.rb:63:in `run'
	 7: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/renderer.rb:84:in `render_document'
	 6: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/renderer.rb:104:in `convert'
	 5: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/renderer.rb:104:in `reduce'
	 4: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/renderer.rb:104:in `each'
	 3: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/renderer.rb:106:in `block in convert'
	 2: from /Users/spence/.gem/ruby/2.6.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll/converters/scss.rb:185:in `convert'
	 1: from /Users/spence/.gem/ruby/2.6.0/gems/sassc-2.4.0/lib/sassc/engine.rb:50:in `render'
style.scss:624: Error: unterminated attribute selector for type (SassC::SyntaxError)
        on line 624:16 of style.scss
>> .prose ol[type="A" s] {

   ---------------^
	43: from /usr/local/opt/ruby/bin/bundle:23:in `<main>'
	42: from /usr/local/opt/ruby/bin/bundle:23:in `load'
	41: from /Users/spence/.gem/ruby/2.6.0/gems/bundler-2.2.21/exe/bundle:37:in `<top (required)>'
	40: from /Users/spence/.gem/ruby/2.6.0/gems/bundler-2.2.21/lib/bundler/friendly_errors.rb:128:in `with_friendly_errors'
	39: from /Users/spence/.gem/ruby/2.6.0/gems/bundler-2.2.21/exe/bundle:49:in `block in <top (required)>'
	38: from /Users/spence/.gem/ruby/2.6.0/gems/bundler-2.2.21/lib/bundler/cli.rb:24:in `start'
	37: from /Users/spence/.gem/ruby/2.6.0/gems/bundler-2.2.21/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
	36: from /Users/spence/.gem/ruby/2.6.0/gems/bundler-2.2.21/lib/bundler/cli.rb:30:in `dispatch'
	35: from /Users/spence/.gem/ruby/2.6.0/gems/bundler-2.2.21/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	34: from /Users/spence/.gem/ruby/2.6.0/gems/bundler-2.2.21/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	33: from /Users/spence/.gem/ruby/2.6.0/gems/bundler-2.2.21/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	32: from /Users/spence/.gem/ruby/2.6.0/gems/bundler-2.2.21/lib/bundler/cli.rb:474:in `exec'
	31: from /Users/spence/.gem/ruby/2.6.0/gems/bundler-2.2.21/lib/bundler/cli/exec.rb:28:in `run'
	30: from /Users/spence/.gem/ruby/2.6.0/gems/bundler-2.2.21/lib/bundler/cli/exec.rb:63:in `kernel_load'
	29: from /Users/spence/.gem/ruby/2.6.0/gems/bundler-2.2.21/lib/bundler/cli/exec.rb:63:in `load'
	28: from /usr/local/lib/ruby/gems/2.6.0/bin/jekyll:23:in `<top (required)>'
	27: from /usr/local/lib/ruby/gems/2.6.0/bin/jekyll:23:in `load'
	26: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/exe/jekyll:15:in `<top (required)>'
	25: from /Users/spence/.gem/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
	24: from /Users/spence/.gem/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
	23: from /Users/spence/.gem/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
	22: from /Users/spence/.gem/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
	21: from /Users/spence/.gem/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
	20: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
	19: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
	18: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in `each'
	17: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
	16: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/commands/build.rb:36:in `process'
	15: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/commands/build.rb:65:in `build'
	14: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:28:in `process_site'
	13: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:80:in `process'
	12: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:211:in `render'
	11: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:538:in `render_pages'
	10: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:538:in `each'
	 9: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:539:in `block in render_pages'
	 8: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:547:in `render_regenerated'
	 7: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/renderer.rb:63:in `run'
	 6: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/renderer.rb:84:in `render_document'
	 5: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/renderer.rb:104:in `convert'
	 4: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/renderer.rb:104:in `reduce'
	 3: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/renderer.rb:104:in `each'
	 2: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.2.0/lib/jekyll/renderer.rb:106:in `block in convert'
	 1: from /Users/spence/.gem/ruby/2.6.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll/converters/scss.rb:182:in `convert'
/Users/spence/.gem/ruby/2.6.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll/converters/scss.rb:190:in `rescue in convert': Error: unterminated attribute selector for type (Jekyll::Converters::Scss::SyntaxError)
        on line 624:16 of style.scss
>> .prose ol[type="A" s] {

   ---------------^

Any suggestions, feedback, or thoughts would be welcomed. I don't think I have time at just this moment to take a look myself, especially since I have a workaround. Maybe there's a shared library used by jekyll-sass-converter and the software pertaining the the issue that I linked to? Thanks again!

sassc-ruby is based on libsass, which is no longer maintained, and the syntax you're using is not supported by libsass.

The new dart-sass on the other hand, do support the syntax you're using.

Please see #116 (comment) for a beta solution to this issue.


This is result of sassc (libsass):

irb(main):001:0> require('sassc')
=> true
irb(main):002:0> SassC::Engine.new('a[href*="cAsE" s] { color: pink; }').render
stdin:1: Error: unterminated attribute selector for href (SassC::SyntaxError)
        on line 1:9 of /stdin
>> a[href*="cAsE" s] { color: pink; }
   --------^
        from /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/engine.rb:50:in `render'
        from (irb):2:in `<main>'
        from /usr/local/lib/ruby/gems/3.0.0/gems/irb-1.3.5/exe/irb:11:in `<top (required)>'
        from /usr/local/bin/irb:23:in `load'
        from /usr/local/bin/irb:23:in `<main>'

This is the result of sass-embedded (dart-sass):

irb(main):001:0> require('sass')
=> true
irb(main):002:0> Sass.render(data: 'a[href*="cAsE" s] { color: pink; }')
=> 
#<Sass::RenderResult:0x000055a6b15919a8
 @css="a[href*=cAsE s] {\n  color: pink;\n}",
 @map=nil,
 @stats=#<Sass::RenderResultStats:0x000055a6b1591a48 @duration=12, @end=1627633996577, @entry="data", @start=1627633996565>>