Title: bug: starting a second `trigger dev` session can crash it or silently break rebuilds · Issue #4286 · triggerdotdev/trigger.dev · GitHub
Open Graph Title: bug: starting a second `trigger dev` session can crash it or silently break rebuilds · Issue #4286 · triggerdotdev/trigger.dev
X Title: bug: starting a second `trigger dev` session can crash it or silently break rebuilds · Issue #4286 · triggerdotdev/trigger.dev
Description: Provide environment information System: OS: macOS 26.6 CPU: (14) arm64 Apple M4 Pro Memory: 454.95 MB / 48.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 24.14.0 - /Users/cheema/.local/state/fnm_multishells/3536_1784491292657/bin/node Yarn:...
Open Graph Description: Provide environment information System: OS: macOS 26.6 CPU: (14) arm64 Apple M4 Pro Memory: 454.95 MB / 48.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 24.14.0 - /Users/cheema/.local/state/fnm_multi...
X Description: Provide environment information System: OS: macOS 26.6 CPU: (14) arm64 Apple M4 Pro Memory: 454.95 MB / 48.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 24.14.0 - /Users/cheema/.local/state/fnm_multi...
Opengraph URL: https://github.com/triggerdotdev/trigger.dev/issues/4286
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bug: starting a second `trigger dev` session can crash it or silently break rebuilds","articleBody":"### Provide environment information\n\nSystem:\n OS: macOS 26.6\n CPU: (14) arm64 Apple M4 Pro\n Memory: 454.95 MB / 48.00 GB\n Shell: 5.9 - /bin/zsh\nBinaries:\n Node: 24.14.0 - /Users/cheema/.local/state/fnm_multishells/3536_1784491292657/bin/node\n Yarn: 1.22.22 - /opt/homebrew/bin/yarn\n npm: 11.9.0 - /Users/cheema/.local/state/fnm_multishells/3536_1784491292657/bin/npm\n pnpm: 10.25.0 - /opt/homebrew/bin/pnpm\n bun: 1.3.5 - /Users/cheema/.bun/bin/bun\n\ntrigger.dev CLI 4.5.4, @trigger.dev/sdk 4.5.4\n\n\n### Describe the bug\n\nI hit this while setting up a new project. I had `trigger dev` running, started another dev session for the same project, and the new one crashed mid-build with an uncaught ENOENT writing to `.trigger/tmp/store/\u003chash>` (screenshot below, stack included).\n\nDigging into the CLI source, here is what I believe happens. `getStoreDir()` (packages/cli-v3/src/utilities/tempDirectories.ts) creates `.trigger/tmp/store` when a dev session starts and registers an exit handler that deletes it recursively. The path is deterministic per project and branch, so every dev session of the same project shares it. When you start a second session, the takeover makes the first one exit, and its cleanup deletes the store out from under the new session. `createFileWithStore()` (packages/cli-v3/src/utilities/fileSystem.ts) ensures the build file's parent directory before writing, but not the store directory, so the next store write fails.\n\nThe timing decides what you see. If the cleanup lands during the new session's initial build, it crashes loudly like mine did. If it lands later, the next watch rebuild prints \"Rebuilding local worker…\" and hangs forever with no error output, which is the nastier version; that one reproduces deterministically. And if the old process happens to die without running its cleanup, nothing breaks at all, which is probably why this can look intermittent.\n\n\n### Reproduction repo\n\nNot project-specific: reproduces on any project with the steps below (it's a CLI dev-session race, no special code involved).\n\n### To reproduce\n\nOrganic: run `npx trigger.dev@latest dev`, wait for \"Local worker ready\", then start a second `trigger dev` for the same project in another terminal. Depending on where the old session's cleanup lands, the new session either crashes with the ENOENT mid-build (screenshot) or hangs silently on a later rebuild.\n\nDeterministic shortcut for the hang variant: with one dev session running, delete `.trigger/tmp/store` (the same deletion the exit cleanup performs), then make any content change to a task file. The rebuild starts and never finishes, with no error output.\n\n### Additional information\n\nA one-line fix works: ensure the store directory exists in `createFileWithStore` right before the store write, the same way the function already ensures the build path a few lines earlier. I patched my local install with it and the exact repro heals: the rebuild completes and the store gets repopulated. Happy to open that PR with a regression test once vouched.\n\nOne side observation from debugging: watch-rebuild errors seem to get swallowed entirely, which is what turns this case into a silent hang instead of a visible error.\n\n\u003cimg width=\"1728\" height=\"1117\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/622ceb3e-9325-45e2-8b8e-634770f0831f\" />","author":{"url":"https://github.com/mcheemaa","@type":"Person","name":"mcheemaa"},"datePublished":"2026-07-19T20:09:52Z","url":"https://github.com/triggerdotdev/trigger.dev/issues/4286"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:6cbadea9-e98b-8cc9-b46b-4e2d35b9ac14 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BE4C:C123A:4D4CFD:6DF248:6AFB0709 |
| html-safe-nonce | f9e3ba736995dca0c39dac02546a016d73bc63f38a2b92d5d35808b3855c6ea5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTRDOkMxMjNBOjRENENGRDo2REYyNDg6NkFGQjA3MDkiLCJ2aXNpdG9yX2lkIjoiMjkyODEwNTQzMTk5NTQ1MTE0NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 447b8e7d0f1ee36720c8583b6e3689dd764fd86a7b5942b3ac8cc54c373ba548 |
| hovercard-subject-tag | issue:4924213347 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/triggerdotdev/trigger.dev/4286/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6066860b0ecb954fc1db9f999bf102da467d0c24ad9972f1d2a5a2fc5c6c0731/triggerdotdev/trigger.dev/issues/4286 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6066860b0ecb954fc1db9f999bf102da467d0c24ad9972f1d2a5a2fc5c6c0731/triggerdotdev/trigger.dev/issues/4286 |
| og:image:alt | Provide environment information System: OS: macOS 26.6 CPU: (14) arm64 Apple M4 Pro Memory: 454.95 MB / 48.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 24.14.0 - /Users/cheema/.local/state/fnm_multi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mcheemaa |
| hostname | github.com |
| expected-hostname | github.com |
| None | 76fb13cb43f1834708971f45a9cfcab5df3177a7582086613d7cdc6e98c4bfde |
| turbo-cache-control | no-preview |
| go-import | github.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git |
| octolytics-dimension-user_id | 95297378 |
| octolytics-dimension-user_login | triggerdotdev |
| octolytics-dimension-repository_id | 572570113 |
| octolytics-dimension-repository_nwo | triggerdotdev/trigger.dev |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 572570113 |
| octolytics-dimension-repository_network_root_nwo | triggerdotdev/trigger.dev |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | afc998826cdd963c8f91a96ae5372809ab5e296b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width