Skip to content
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

v4.0.0-rc1 - Bundled application.tailwind.css gets 404 trying to load /assets/tailwindcss #470

Closed
aguynamedben opened this issue Jan 24, 2025 · 4 comments · Fixed by #474

Comments

@aguynamedben
Copy link

Hi, thank you for making this library. It's been awesome to get setup.

I have everything working, and it looks great, but I noticed in my Chrome Dev Tools Console an error:

Image

The error doesn't seem to be breaking anything, but I'm not sure what's triggering it. It seems that the bundled version of application.tailwind.css, which just has the contents @import "tailwindcss"; is triggering a network call to GET http://localhost:3000/assets/tailwindcss. I'm not super familiar with the @import statement in CSS, but I find that odd.

The Sources tab shows:

Image

If I comment out that import in application.tailwind.css in an attempt to stop the error, Tailwind stops loading all together and my page formatting goes ugly.

This is a pretty "stock" v4.0.0-rc1 install. Screenshots of my diff below.


Image
Image

tailwind.config.js deleted, because I basically got to 4.0.0-rc1 but removing everything from 3.x and running the tailwindcss:install task with 4.x which doesn't install tailwind.config.js.

Image
@flavorjones
Copy link
Member

Thanks for the clear bug report. Looking at it now.

flavorjones added a commit that referenced this issue Jan 24, 2025
This file should not be included in the stylesheet link tags served to
user agents.

Fixes #470
@flavorjones
Copy link
Member

Proposed fix is at #474

flavorjones added a commit that referenced this issue Jan 24, 2025
This file should not be included in the stylesheet link tags served to
user agents.

Fixes #470
flavorjones added a commit that referenced this issue Jan 24, 2025
This file should not be included in the stylesheet link tags served to
user agents.

Fixes #470
@pdobb
Copy link

pdobb commented Jan 27, 2025

UPDATE: Fixed in rc3. Thanks!


Not sure w're all the way there yet on this one...

I just went through the upgrade process using tailwindcss-rails v4 rc2. I'm on rails v8. I'm somehow still getting a reference to tailwindcss (no fingerprint) as a plain type. I can't figure out why or how.

Image

Can confirm that the old <%= stylesheet_link_tag "tailwind", "data-turbo-track": "reload" %> was removed from my application layout via your wonderful update utility (rails tailwindcss:upgrade): pdobb/minesweeper_alliance@1b1e7e7#diff-f43fe075643e681b2c01c2f853bb0c4299d135b47fcbd4da96890d521c49e3ebL20

Not sure what to investigate, but happy to if it helps. Thanks!

@EricGusmao
Copy link
Contributor

This happens due to stylesheet_link_tag helper when you pass the :all or :app flag. I created a new issue at #477

flavorjones added a commit that referenced this issue Jan 27, 2025
Fixes #477, originally #470 was incompletely fixed.
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 a pull request may close this issue.

4 participants