Skip to content

@media (width >= 40rem) { < SassC::SyntaxError: Error: unclosed parenthesis in media query expression (SassC::SyntaxError) #526

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

Closed
rgaufman opened this issue Apr 1, 2025 · 5 comments

Comments

@rgaufman
Copy link

rgaufman commented Apr 1, 2025

When I build assets with this command:

$ RAILS_ENV=production RAILS_GROUPS=assets bin/rails assets:precompile

It creates this file: ./app/assets/builds/tailwind.css

This file internally has code like this

    }
    @media (width >= 48rem) {
      max-width: 48rem;
    }
    @media (width >= 64rem) {
      max-width: 64rem;
    }
    @media (width >= 80rem) {
      max-width: 80rem;
    }
    @media (width >= 96rem) {
      max-width: 96rem;
    }

This throws this exception:

$ RAILS_ENV=production RAILS_GROUPS=assets bin/rails assets:precompile
≈ tailwindcss v4.0.17

Done in 180ms
autoprefixer: /Users/hackeron/Development/TetherX/tetherx/app/assets/stylesheets/application.scss:15853:5: Replace color-adjust to print-color-adjust. The color-adjust shorthand is currently deprecated.
autoprefixer: /Users/hackeron/Development/TetherX/tetherx/app/assets/stylesheets/application_dark_theme.scss:15853:5: Replace color-adjust to print-color-adjust. The color-adjust shorthand is currently deprecated.
bin/rails aborted!
SassC::SyntaxError: Error: unclosed parenthesis in media query expression (SassC::SyntaxError)
        on line 302:13 of stdin
>>     @media (width >= 40rem) {

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

Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

I tried adding this to my assets.rb but it didn't help:

Rails.application.config.assets.precompile -= %w( tailwind.css )
@patriciomacadden
Copy link
Contributor

Hi @rgaufman , it looks like you're using sassc-rails, aren't you? Please look at this section of the readme. sassc-rails is incompatible with this gem, so you need to remove it.

@rgaufman
Copy link
Author

rgaufman commented Apr 2, 2025

I don't have sassc-rails but I do have sass-rails and font-awesome-sass which both depend on sassc it seems. Is sass in general not compatible with this?

@patriciomacadden
Copy link
Contributor

sass-rails depends on sassc-rails, so you still have sassc-rails in your project. You need to remove them if you want to use tailwindcss-rails, unfortunately

@rgaufman
Copy link
Author

rgaufman commented Apr 3, 2025

Understood, thank you. Going through a very long and painful migration away from sprockets now t remove sassc :)

@rgaufman rgaufman closed this as completed Apr 3, 2025
@patriciomacadden
Copy link
Contributor

you're welcome!

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

2 participants