Cli exits process instantly when called by turborepo's run command in watch mode
See original GitHub issueWhat version of Tailwind CSS are you using?
v3.0.24
What build tool (or framework if it abstracts the build tool) are you using?
Turborepo turbo run with tailwindcss cli
What version of Node.js are you using?
v16.15.1
What browser are you using?
N/A
What operating system are you using?
macOS
Describe your issue
Tailwind cli in watch mode exits early when run by turbo run. This makes it unusable in turborepo projects.
I’ve tracked it down to the event listeners on stdin
Because turbo repo doesn’t pipe through stdin, we get an end event back when calling process.stdin.resume()
I’ve added a potential solution in a PR on my fork here
I’m not completely sure you would consider it your issue, but I think there is merit in this flag being useful.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
CLI Reference - Turborepo
When --continue is true , turbo will exit with the highest exit code value encountered during execution. turbo run build --continue. --cwd.
Read more >Prevent Turborepo to exit early if a task fails to execute
By default, Turborepo will stop its execution if it runs into an error. ... We can do this by adding the --continue flag...
Read more >Commands.dev - Find commands at the speed of thought
Commands.dev is a searchable, templated catalog of popular terminal commands curated from across the internet.
Read more >Wireit | Best of JS
Use the npm run commands you already know; ⛓️ Automatically run dependencies between npm scripts in parallel; Watch any script and continuously re-run...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Wow that fix from esbuild really is super elegant! Ctrl-D, Ctrl-C, and Ctrl-Z all still work as expected in a terminal but launching without stdin works too. That’s pretty cool. I’ve just merged in the fix for this which should hit our insiders build in a few minutes.
Thanks for the investigation it was super helpful! 🎉
We’ve run into some issues with this fix unfortunately and have reverted it for our next tagged release. What’s happening is that the CLI process is left running if the thing that launched it is unable to send a signal to the process. This can happen because either the parent process has crashed or because the runtime doesn’t have the ability to send signals (Erlang is an example of this).
However, it appears that Turborepo updated their Tailwind CSS example to use the
concurrently
npm package which happens to sidestep this problem entirely. This is becauseconcurrently
both doesn’t need stdin by default and handles it correctly for child processes. I would suggest updating your scripts to run the CLI usingconcurrently
to ensure the CLI keeps working with the upcoming releases: