Skip to content

Tailwind 4.0.4 - Command failed with exit 1 - Heroku Deploys Rejected #16311

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
Chadh13 opened this issue Feb 6, 2025 · 2 comments
Closed

Tailwind 4.0.4 - Command failed with exit 1 - Heroku Deploys Rejected #16311

Chadh13 opened this issue Feb 6, 2025 · 2 comments

Comments

@Chadh13
Copy link

Chadh13 commented Feb 6, 2025

What version of Tailwind CSS are you using?

v4.0.4

What build tool (or framework if it abstracts the build tool) are you using?

Rails - tailwindcss- w/ https://github.com/flavorjones/tailwindcss-ruby underneath

What version of Node.js are you using?

N/A

What browser are you using?

N/A

What operating system are you using?

Stack track suggests that the server is targeting the x86_64-linux-gnu distribution

Reproduction URL

This is a deploy issue so it's a bit hard to provide a repro URL. I've included a deploy stack trace below. I haven't figured out how to extend/patch into the rake deploy task yet within the heroku deploy process but will try to do so and provide the extended trace if I am able to.

My current hypothesis is that any app targeting Tailwind 4.0+ that is attempting to deploy to a heroku dyno is experiencing this.

remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote: cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
remote:        Running: rake assets:precompile
remote:        I, [2025-02-06T18:32:25.438556 #1542]  INFO -- honeybadger: ** [Honeybadger] Reporting error id=29aba613-30a1-4e52-891f-9a3588871127 level=1 pid=1542
remote:        rake aborted!
remote:        Command failed with exit 1: /tmp/build_f389ed2a/vendor/bundle/ruby/3.2.0/gems/tailwindcss-ruby-4.0.4-x86_64-linux-gnu/exe/x86_64-linux-gnu/tailwindcss
remote:        /tmp/build_f389ed2a/vendor/bundle/ruby/3.2.0/gems/tailwindcss-rails-4.0.0/lib/tasks/build.rake:7:in `system'
remote:        /tmp/build_f389ed2a/vendor/bundle/ruby/3.2.0/gems/tailwindcss-rails-4.0.0/lib/tasks/build.rake:7:in `block (2 levels) in <main>'
remote:        Tasks: TOP => assets:precompile => tailwindcss:build
remote:        (See full trace by running task with --trace)
remote:        I, [2025-02-06T18:32:25.507438 #1542]  INFO -- honeybadger: ** [Honeybadger] Success ⚡ https://app.honeybadger.io/notice/29aba613-30a1-4e52-891f-9a3588871127 id=29aba613-30a1-4e52-891f-9a3588871127 code=201 level=1 pid=1542
remote:
remote:  !
remote:  !     Precompiling assets failed.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote:
remote:  !     Push failed
remote:
remote: Verifying deploy...
remote:
remote: !	Push rejected to [app-name].
remote:
To https://git.heroku.com/[app-name].git
 ! [remote rejected]     get-operations-outta-here-mister -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/[app-name].git'

Describe your issue

Attempts to deploy version 4.X+ of Tailwind to Heroku servers fail due to
Command failed with exit 1: /tmp/build_f389ed2a/vendor/bundle/ruby/3.2.0/gems/tailwindcss-ruby-4.0.4-x86_64-linux-gnu/exe/x86_64-linux-gnu/tailwindcss

Was following #15181 and hoping that it was a related issue that would be resolved from the same changes. Unfortunately it's not.

Originally reported here: rails/tailwindcss-rails#450 (comment)

I'm also going to submit a ticket to Heroku to see if I can get any insight from their end since end users like me have very limited access and control over what's going on within the deploy process. I'll reply with updates as they come.

Please let me know how I can help debug or understand this.

@philipp-spiess
Copy link
Member

Hey! Thanks for the report. I do think we'll need to understand the full command that the CLI is being run with and any eventual outputs, is this really exiting with error code 1 and not printing to stdout or stderr at all? 🤔 Maybe there is a verbose mode that you can enable somehow?

From the tailwindcss binary perspective it's possible to get more output by setting a DEBUG flag to 1. But I would expect to at least see something like ≈ tailwindcss v4.0.4 regardless of commands being run with.

@Chadh13
Copy link
Author

Chadh13 commented Feb 8, 2025

Hey @philipp-spiess, I was finally able to reproduce this locally and track down the issue.

I'm honestly not sure if this is a tailwindcss issue or an issue with the rails build and asset pipeline version. The tl;dr is that I was trying to use a legacy tailwind.config.js file via @config and that was what caused the builds to fail. I ended up migrating the config file into CSS variables vs discovering which section of the config was breaking things since I didn't have early success pinpointing the issue within the config file itself.

A more detailed break down is here if that's useful or of interest:
rails/tailwindcss-rails#450 (reply in thread)

@Chadh13 Chadh13 closed this as completed Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants