SassC error running fly:build

Hi,

I’ve got a Rails 7 app using Tailwind CSS which I have tried to deploy. The deployment runs into an error in the fly:build stage, with some sort of CSS error:

[stage-3 7/7] RUN bin/rails fly:build:
#20 3.204 ["/app/vendor/bundle/ruby/2.7.0/gems/tailwindcss-rails-2.0.16-x86_64-linux/exe/x86_64-linux/tailwindcss", "-i", "/app/app/assets/stylesheets/application.tailwind.css", "-o", "/app/app/assets/builds/tailwind.css", "-c", "/app/config/tailwind.config.js", "--minify"]
#20 4.327
#20 4.328 Rebuilding...
#20 5.093
#20 5.093 Done in 826ms.
#20 6.494 rails aborted!
#20 6.494 SassC::SyntaxError: Error: Function rgb is missing argument $green.
#20 6.494         on line 1 of stdin
#20 6.494 >> ue-600{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opac
#20 6.494    ------------------------------------------^

The app works fine locally, so I’m not sure how to fix this error as it seems to be a problem with the gem. Any help would be appreciated, thanks.

Just to be clear, the app works locally with RAILS_ENV=production ?

Others have reported similar problems with tailwind: Function rgb is missing argument $green. · tailwindlabs/tailwindcss · Discussion #6738 · GitHub

1 Like

thanks for the link, don’t know how I didn’t find that page!

adding this to my production.rb file fixed the issue:

config.assets.css_compressor = nil