cssbundling-rails icon indicating copy to clipboard operation
cssbundling-rails copied to clipboard

Rails includes the unprocessed CSS file in the HTML causing a 404 error

Open j127 opened this issue 8 months ago • 3 comments

When I start a Rails app with this command, it causes a 404 error by default, because it's loading the unprocessed application.tailwind.css file in the browser, which tries to do an @import "tailwindcss";.

Here's a repo that reproduces the problem. I wrote notes in each of the four commits.

It also shows bug #169 (where Bun is used even when yarn is managing the project), which I think is critical, because it breaks projects created with the rails new command.

Screenshots in Firefox:

Image

Image

The contents of that file that is served to the browser:

@import "tailwindcss";

The actual processed Tailwind code is in the other CSS file above that raw one.

j127 avatar May 07 '25 21:05 j127