-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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] Standalone cli doesn't bundle tailwindcss js library #15235
Comments
Hello, It seems that the problem arises when using the standalone tailwindcss-linux-x64 binary directly, as opposed to installing it via npm. When running the binary, it returns error code 1 with no message, which doesn't provide much information about the root cause of the failure. However, when you install Tailwind via npm, it works correctly, generating the output file as expected. One possible explanation could be a mismatch between the binary's expected environment or configuration and the local system setup. It may also be that the binary is not automatically handling some dependencies or configurations that the npm installation process takes care of. Additionally, error messages are sometimes omitted for issues hmfusa app like missing environment variables or misconfigured paths, which could explain why you're seeing a generic error code without more details. |
This problem still exists on v4.0.1. I'm using the standalone CLI tool (via homebrew) because I'm developing a site entirely in Go. It worked wonderfully prior to v4.0.0. My v3
Likewise my v4 tailwind.css is extremely simple:
In order to unblock my development, I've had to |
Same here! |
Similar issue with plugins. Adding custom plugins seems to crash Tailwind: /* app.css */
@import "tailwindcss";
@plugin "./myplugin.js"; // myplugin.js, https://v3.tailwindcss.com/docs/plugins#adding-components
const plugin = require('tailwindcss/plugin')
module.exports = {
plugins: [
plugin(function({ addComponents }) {
addComponents({
'.btn': {
padding: '.5rem 1rem',
borderRadius: '.25rem',
fontWeight: '600',
},
})
})
]
}
No output is produced. |
Hey! I have the same error with the plugin. No output is generated if I try to add a custom plugin. I noticed that the root cause of the error might be the following line inside my plugin file: const plugin = require('tailwindcss/plugin') Unfortunately, you don't need this because you can just export a basic function (no need to wrap it into So instead of this: const plugin = require('tailwindcss/plugin')
module.exports = plugin(function() {
// your plugin code
}) try this module.exports = function() {
// your plugin code
} This solves the problem for me and an output is generated (the plugin also works fine) |
Yeah, the docs on this are really lacking atm...
Good to know! Unfortunately this does not work for 3rd party plugins like this one (because the import is done in the plugin code): const { addIconSelectors } = require('@iconify/tailwind')
module.exports = addIconSelectors({
prefixes: ["tabler"],
scale: 1.75
}) Works perfectly fine when adding |
Does anyone have updates/workarounds on this topic? 🤔 |
@axzilla |
Yeah it works now, thanks! =) |
What version of Tailwind CSS are you using?
v4.0.0-beta.3
What build tool (or framework if it abstracts the build tool) are you using?
None
What version of Node.js are you using?
v22.8.0
What browser are you using?
N/A
What operating system are you using?
Ubuntu 24.10
Reproduction URL
https://github.com/leifmetcalf/tailwind-repro/tree/8cfa9c2b2b13a3d3e87cc115000ee553ea0a11df
Describe your issue
Run this command in the reproduction repo above
The command returns error code 1 with no message. Installing tailwind with
npm install tailwindcss
fixes the problem and the output file is created as expected.The text was updated successfully, but these errors were encountered: