Skip to content

Pin tailwindcss to v3 to fix rails new #168

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
wants to merge 1 commit into from

Conversation

skipkayhil
Copy link
Member

Fixes rails/rails#54575

Many breaking changes were made in v4 that will require changes to cssbundling-rails' Tailwind installer.

This commit temporarily pins Tailwind to v3 to restore rails new' ability to generate new cssbundling-rails applications with Tailwind.

Many breaking changes were made in v4 that will require changes to
`cssbundling-rails`' Tailwind installer.

This commit temporarily pins Tailwind to v3 to restore `rails new`'
ability to generate new `cssbundling-rails` applications with Tailwind.
@skipkayhil
Copy link
Member Author

@dhh if you have some time could you review/release this PR or #164 ?

rails new with cssbundling-rails/tailwind is currently broken due to the recently released breaking changes in Tailwind v4.

@dhh
Copy link
Member

dhh commented Feb 23, 2025

@flavorjones Seems like the new release busted rails new. Can you either rollback or roll forward with a root fix?

@skipkayhil
Copy link
Member Author

I don't think this is related to tailwindcss-ruby/tailwindcss-rails.

The can't find executable tailwindcss for gem tailwindcss-ruby error is a red-herring due to Tailwind changing their binary from tailwindcss (v3) to @tailwind/cli (v4). Running npx build:css previously would use the tailwindcss binary from the npm package. Since it no longer exists in Tailwind v4, it looks for tailwindcss in the PATH and finds Mise's shim (which would be from tailwindcss-ruby) which leads to the error. But the error is misleading, because in cssbundling-rails we want the npm package running here, not the tailwindcss-ruby executable.

@flavorjones
Copy link
Member

Right, what @skipkayhil said. I don't think this is related to the tailwindcss-ruby gem.

@dhh
Copy link
Member

dhh commented Feb 24, 2025

Ahh, yes. I see. I've merged 163 and released 1.4.2: https://github.com/rails/cssbundling-rails/releases/tag/v1.4.2

@dhh dhh closed this Feb 24, 2025
@skipkayhil skipkayhil deleted the hm-pin-tw-3 branch February 24, 2025 16:30
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.

Incompatible rails new options: -c tailwind -j esbuild
3 participants