Skip to content

Tailwind v4 CLI fails silently in Linux with no errors #15730

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

Open
danjac opened this issue Jan 23, 2025 · 9 comments
Open

Tailwind v4 CLI fails silently in Linux with no errors #15730

danjac opened this issue Jan 23, 2025 · 9 comments

Comments

@danjac
Copy link

danjac commented Jan 23, 2025

What version of Tailwind CSS are you using?

4.0.0

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

For example: postcss-cli 8.3.1, Next.js 10.0.9, webpack 5.28.0

tailwindcss-linux-x64-4.0.0

What version of Node.js are you using?

N/A

What browser are you using?

N/A

What operating system are you using?

Linux/Fedora

Reproduction URL

N/A

Describe your issue

When running the following command:

~/.local/bin/tailwindcss-linux-x64-4.0.0 --output ./static/tailwind.css --minify --input ./static/app.css

The command fails with no errors output to terminal and no CSS file is built. Running the --watch flag has the same result.

As there are no errors, it is impossible to diagnose the issue further. The previous used version 3.4.14 worked.

@danjac
Copy link
Author

danjac commented Jan 23, 2025

Playing with the command line, it appears the issue is with the --input i.e. the css file: removing this flag generates the CSS.

Again though the bug is not the input CSS itself, but the lack of a stacktrace or errors that indicate what the problem is.

@doits
Copy link

doits commented Jan 23, 2025

Try to run it with DEBUB=1 env var, e.g. DEBUG=1 ~/.local/bin/tailwindcss-linux-x64-4.0.0 .... Maybe this gives some more output.

@danjac
Copy link
Author

danjac commented Jan 23, 2025

Try to run it with DEBUB=1 env var, e.g. DEBUG=1 ~/.local/bin/tailwindcss-linux-x64-4.0.0 .... Maybe this gives some more output.

Same result. No error output.

@danjac
Copy link
Author

danjac commented Jan 23, 2025

By process of elimination it appears to be the included tailwind.config.js

@config '../tailwind.config.js`;

Commenting out that line, the build works. With the include, it fails silently. I'd like to migrate away from the Javascript config, but can't find any documentation on migrating over the plugins (typography,forms etc).

@tduffield
Copy link

tduffield commented Jan 23, 2025

So, I ran into the same issue, and after going through the migration process away from the JS config file, for me the issue appeared to be a specific plugin (for me, it was flowbite/plugin). (Plugin documentation).

Update: Created an issue with Flowbite regarding my specific failure case: themesberg/flowbite#1020. If they find a solution to their specific problem, it may help fix problems with other plugins.

@danjac
Copy link
Author

danjac commented Jan 24, 2025

In my case, these are the core Tailwind plugins e.g. @tailwindcss/typography. The v3 Tailwind (Rust) CLI was able to import these without any problems, in v4 it just breaks.

So there are 3 issues:

  1. The Rust CLI fails silently with no errors or stacktraces when handling imports in the tailwind.config.js file. This should never happen: any errors should be reported to the user to enable troubleshooting. Note that using DEBUG=1 flag does not work either. This at least is the case in Linux (note this also includes Docker images running Tailwind).
  2. The plugin system no longer works with CLI v4.
  3. The upgrade documentation, as far as I can see, does not provide any information in replacing or migrating these plugins (referring here to the core Tailwind plugins, let alone 3rd party). The docs for the plugins themselves have not been updated with any info on compatibility with v4.

So it looks like the maintainers did not test the CLI+plugins, with the result that this will no longer work with the majority of Tailwind setups that rely on this tool.

Edit: looks like the way to add plugins is detailed here: https://tailwindcss.com/docs/functions-and-directives#plugin-directive

@plugin "@tailwindcss/forms";
@plugin "@tailwindcss/typography";

@Skulli
Copy link

Skulli commented Mar 5, 2025

I am just experiencing the same bug on MacOS with my 4.0.9 setup after upgrading from 3.4. No error messages, no output is generated.

my setup

application.tailwind.css

@import 'tailwindcss';

build command

 DEBUG=1 npx tailwindcss/cli  --postcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css

working command

 ./node_modules/.bin/tailwindcss --postcss  -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css

@philipp-spiess
Copy link
Member

Hey all! Sorry for the late reply this seems to have slipped through the cracks a bit. Are you still having issues with this? I'd appreciate a minimal reproduction setup that I can run locally to figure out why the CLI just stops in your cases.

@danjac
Copy link
Author

danjac commented Apr 23, 2025

I've not had any issues since updating to django-tailwind-cli version 4.2.3 or so: not sure if problem with "silently failing with no errors" still persists, but not run into it myself.

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

5 participants