tablecheck / dartsass-sprockets

Integrate Dart Sass with Sprockets (Ruby on Rails asset pipeline)
MIT License
39 stars 8 forks source link

SassC::SyntaxError: Error: Silent comments aren't allowed in plain CSS. #14

Open h0jeZvgoxFepBQ2C opened 1 year ago

h0jeZvgoxFepBQ2C commented 1 year ago

Hi,

we upgraded from webpacker to dartsass-sprockets but get now following errors during compilation:

SassC::SyntaxError: Error: Silent comments aren't allowed in plain CSS.
  ╷
1 │ //= require jquery-ui/all
  │ ^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  ../../../../jquery-ui-rails-6.0.1/app/assets/stylesheets/jquery-ui.css 1:1                             @import
  sassc-embedded-import:2 1:9                                                                            @import
  /Users/myuser/coding/myproject/app/assets/stylesheets/customer_layout.css.scss 2:9  root stylesheet
../../.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/jquery-ui-rails-6.0.1/app/assets/stylesheets/jquery-ui.css:1

Caused by:
Sass::CompileError: Silent comments aren't allowed in plain CSS.

Tasks: TOP => assets:precompile

It seems that dartsass tries to compile .css files (not .scss files) - how can I fix this?

johnnyshields commented 11 months ago

The workaround is to rename everything to .scss.