-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Cli exits process instantly when called by turborepo's run command in watch mode #8517
Comments
Thanks for flagging this and for doing the detective work to figure out the underlying cause! I haven't used Turborepo and don't know a ton about how all these things interact with each other but I saw this related issue on esbuild where it was solved without any additional flags for their use case: Do you think something like this could work here as well or is this situation different? |
No worries, I'm happy to help. Yes that looks like an elegant solution. I've just checked locally and it works nicely! Hopefully this would still match @josevalim use case? And just to have a bit of context on how turborepo handles process management. It watches for system signals and pass them on. I believe it also closes all processes when one child process has non-zero exit, unless the |
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! 🎉 |
Great thanks for getting this sorted so quickly! |
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 {
"scripts": {
"watch": "concurrently \"tailwindcss -i ./src/styles.css -o ./dist/styles.css --watch\""
}
} |
What 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
Reproduction URL
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 #1026 on Turborepo
The text was updated successfully, but these errors were encountered: