ruby-on-railstailwind-csssprockets

tailwindcss typography "SassC::SyntaxError: Error: unterminated attribute selector for type"


I upgraded the tailwindcss-rails gem and got this error when compiling assets for production:

bundle exec rails assets:precompile
rails aborted!
SassC::SyntaxError: Error: unterminated attribute selector for type
        on line 1009:16 of stdin
>> .prose ol[type="A" s] {

   ---------------^
/home/circleci/project/vendor/bundle/ruby/3.0.0/bundler/gems/sassc-ruby-4fce2b635ca5/lib/sassc/engine.rb:50:in `render'
/home/circleci/project/vendor/bundle/ruby/3.0.0/gems/sassc-rails-2.1.2/lib/sassc/rails/compressor.rb:29:in `call'
/home/circleci/project/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/sass_compressor.rb:30:in `call'

Solution

  • I kept having the SassC::SyntaxError. Adding the following line in production.rb resolved the issue:

    config.assets.css_compressor = nil
    

    It will prevent sassc-rails from setting sass as the compressor.

    I found the answer here.