Skip to content
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

Fix the killing of processes in monorepo #450

Merged
merged 1 commit into from
Feb 7, 2023

Conversation

jplhomer
Copy link
Contributor

@jplhomer jplhomer commented Feb 7, 2023

In #443, we added a -k to the dev script in our demo-store. @frandiox probably knows why for sure, but my guess is that we wanted to prevent stray processes from running when one of them fails.

This works fine when you're running npm run dev from within the demo-store template itself! BUT: when you run it as part of the turbo monorepo dev command, shit breaks with no real error. I'm guessing this is related to a false positive within concurrently, perhaps due to turbo or due to the preceding && command.

demo-store:dev: > demo-store@0.0.0 dev:css
demo-store:dev: > postcss styles --base styles --dir app/styles -w
demo-store:dev:
demo-store:dev: npm ERR! Lifecycle script `dev` failed with error:
demo-store:dev: npm ERR! Error: command failed
demo-store:dev: npm ERR!   in workspace: demo-store@0.0.0
demo-store:dev: npm ERR!   at location: /Users/jasonkurian/src/github.com/Shopify/h2/templates/demo-store

https://github.com/open-cli-tools/concurrently#usage

Anyway, this seems to fix it.

Copy link
Contributor

@JaKXz JaKXz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Josh!

@jplhomer jplhomer merged commit 969f05a into 2023-01 Feb 7, 2023
@jplhomer jplhomer deleted the jl-fix-killing-processes branch February 7, 2023 17:56
@frandiox
Copy link
Contributor

frandiox commented Feb 8, 2023

Funny thing is that I was the one removing -k months ago because I found this bug as well... but I forgot about it 😅
I added it back because when calling process.exit(1) in the CLI after finding an error (e.g. when a config value is wrong), concurrently keeps the CSS/Tailwind process running.

Glad the full --kill-others-on-fail flag does the trick 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants