Skip to content

Conversation

NikhilKottoli
Copy link

@NikhilKottoli NikhilKottoli commented Oct 3, 2025

Changes application.tailwind.css to application.css to resolve issues
with Rails 8's Propshaft asset pipeline when using stylesheet_link_tag :app.
Otherwise creates application.tailwind.css giving this issue:
rails/rails#55791

The .tailwind.css extension was originally used to differentiate between
CSS frameworks, but now causes 404 errors in Rails 8 with Propshaft, which
includes all stylesheets files when using the :app symbol. This causes the
source file to be referenced alongside the compiled output.

Using application.css as the source filename aligns with modern Rails
conventions and prevents conflicts while maintaining backward compatibility
with Rails 7.

@daniel-niknam
Copy link

I think this filename is sort of standard, as you can see the same pattern for other css libraries like Bootstrap CSS. As I said in the issue, there might be something else going on, because I can see everything just works fine for Bootstrap CSS. I didn't have the time to look into it in more depth, but maybe there is something else causing the issue 🤷

What if we change the output to match the generated CSS file? Not sure if that helps.

@NikhilKottoli
Copy link
Author

NikhilKottoli commented Oct 4, 2025

for bootstrap we have application.bootstrap.scss but for tailwind we have application.tailwind.css. When Propshaft sees stylesheet_link_tag :app, it includes all CSS files. The .scss extension means Propshaft ignores it but the .css extension (even with .tailwind) makes Propshaft try to serve it, causing the 404 error because it's a source file, not a built asset.

This is what I understand about the problem. One way to solve this would be to use a non-css extension or move it to a subdirectory that Propshaft doesn't scan

or change the installer so it does not use :app

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

Successfully merging this pull request may close these issues.

2 participants