Skip to content

Issue with asset:precompile not processing calculated utility classes. #549

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

Open
antonysastre opened this issue May 23, 2025 · 0 comments
Open

Comments

@antonysastre
Copy link

antonysastre commented May 23, 2025

Using Rails 8.0.2, newly generated app with the --css tailwindcss option.

Locally in development everything works fine with an app/assets/tailwind/application.css with only the @import "tailwindcss"; directive from the installation. I can use all classes and the views are rendered properly when running the Procfile.dev defined servers (including the tailwindcss:watch).

But, when i push my app for deployment with Kamal i've stumbled upon issues when reaching the assets:precompile step.

At first it exited with an error not able to deploy the app. I was using the old @apply { ... } directive to create som custom classes such as '.input-select' to re-use on <select …> components. The error stated that it couldn't find px-3 which was one of the utility classes used in the directive. I deleted all this and just using classes in views now.

The assets:precompile step is now running successfully on the remote server, the app is running but the views only get styling on non-calculated utility classes i.e. shadow-lg, but calculated ones such as px-3, h-16 etc – they are simply not being part of the compiled css.

Any suggestions on what might I might be missing?

  • Gemfile.lock
    tailwindcss-rails (4.2.3)
      railties (>= 7.0.0)
      tailwindcss-ruby (~> 4.0)
    tailwindcss-ruby (4.1.7)
    tailwindcss-ruby (4.1.7-aarch64-linux-gnu)
    tailwindcss-ruby (4.1.7-aarch64-linux-musl)
    tailwindcss-ruby (4.1.7-arm64-darwin)
    tailwindcss-ruby (4.1.7-x86_64-linux-gnu)
    tailwindcss-ruby (4.1.7-x86_64-linux-musl)
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

1 participant