turbo: Turbo randomly gets stuck on build process
What version of Turborepo are you using?
1.2.6
What package manager are you using / does the bug impact?
pnpm
What operating system are you using?
Mac
Describe the Bug
I have a relatively large private repository (65 packages and growing) in which I’m attempting to use Turbo but running into an issue with builds that I don’t encounter with any other tool. When I run turbo run build it’ll start to build and then randomly get stuck and do nothing, e.g. go halfway through building and then just stop and sit there. This doesn’t happen deterministically on the same package every time, which could be an indicator for a circular dependency but there are none.
This issue also doesn’t exists if I run the workspace build via pnpm or use https://github.com/folke/ultra-runner with ultra -r build instead of turbo run build. The setup isn’t anything crazy, it’s just the stock pnpm setup from https://github.com/vercel/turborepo/tree/main/examples/with-pnpm with 65 packages inside the packages directory.
Is there anything I could or should look at to debug this? Loving how blazing fast Turbo is but this build issue prevents me from fully utilising it.
Expected Behavior
Finish the build process without any issues like pnpm and ultra do.
To Reproduce
It’s a relatively large private repository so not sure what the best way to provide reproduction steps would be. The configuration is fairly simple:
{
"$schema": "https://turborepo.org/schema.json",
"pipeline": {
"build": {
"dependsOn": [
"^build"
],
"inputs": [
"src/**/*.ts",
"package.json"
],
"outputs": [
"distribution/**"
]
}
}
}
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 7
- Comments: 25 (4 by maintainers)
I found my issue. Looks like it’s not related to turborepo, but a bad actor in a dependency that I can replace.
With that said if your task seems to be hung, check your processes for node instances that are spawning, and not being cleaned up. This was the issue in my case, and I did the following to find out what was going on.
Allow the node instance to be inspected
Then go to chrome and open
chrome://inspectI’ve experienced similar issues in CI environments (GitHub Actions, Amplify). I was running
tsc buildfor each one out of ~70 packages in a monorepo and the build would fail randomly at more or less the same spot but without any hint at what went wrong.Setting
--concurrency=100%fixed it. Sinceconcurrencyis set to 10 by default, could it be Turbo was trying to allocate more resources than the environment allowed?