Title: CLI accepts an esbuild version outside its declared range, producing corrupt sourcemaps · Issue #4801 · triggerdotdev/trigger.dev · GitHub
Open Graph Title: CLI accepts an esbuild version outside its declared range, producing corrupt sourcemaps · Issue #4801 · triggerdotdev/trigger.dev
X Title: CLI accepts an esbuild version outside its declared range, producing corrupt sourcemaps · Issue #4801 · triggerdotdev/trigger.dev
Description: What happened trigger.dev@4.5.11 declares esbuild ^0.23.0. Our repo had a root-level npm overrides entry pinning esbuild to 0.25.0, added for GHSA-67mh-4wv8-2f99. npm honours the override, so the CLI bundled with 0.25.0 without warning. ...
Open Graph Description: What happened trigger.dev@4.5.11 declares esbuild ^0.23.0. Our repo had a root-level npm overrides entry pinning esbuild to 0.25.0, added for GHSA-67mh-4wv8-2f99. npm honours the override, so the C...
X Description: What happened trigger.dev@4.5.11 declares esbuild ^0.23.0. Our repo had a root-level npm overrides entry pinning esbuild to 0.25.0, added for GHSA-67mh-4wv8-2f99. npm honours the override, so the C...
Opengraph URL: https://github.com/triggerdotdev/trigger.dev/issues/4801
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"CLI accepts an esbuild version outside its declared range, producing corrupt sourcemaps","articleBody":"## What happened\n\n`trigger.dev@4.5.11` declares `esbuild ^0.23.0`. Our repo had a root-level npm `overrides` entry pinning `esbuild` to `0.25.0`, added for GHSA-67mh-4wv8-2f99. npm honours the override, so the CLI bundled with 0.25.0 without warning.\n\nesbuild 0.25.0 has an out-of-bounds source-index regression, fixed in 0.25.1, that drops input `sources` entries while keeping the mapping indices. Two of our deployed chunks came out internally inconsistent:\n\n- `trigger/slack-attention-agent.mjs.map`: 6 `sources`, mappings referencing index 37\n- a shared `ai` chunk: 171 `sources`, mappings referencing index 200\n\n## Impact\n\nThe worker installs `source-map-support` globally (`entryPoints/managed-run-worker.js`). Once a stack contained a frame from either chunk, `originalPositionFor` threw `Error: No element indexed by 6`. `recordSpanException` (`otel/utils.ts`) and the AI SDK's default error handler (`console.error(error)`) both read `.stack` without a guard, so that exception replaced the error being reported.\n\nEvery `chat.agent` turn failed for a week with `No element indexed by 6`. The original error never surfaced anywhere, including in `streamText`'s `onError`, which received the substituted message instead. Scheduled tasks on the same deployment kept working, because they never format a stack.\n\n## Reproduction\n\nTrigger project on `runtime: node-22` with `ai@7.0.66` and `@ai-sdk/anthropic@4.0.39`, plus npm `overrides: { \"esbuild\": \"0.25.0\" }`. Build through `loadConfig` -> `buildWorker`, then decode each emitted `.map` and check that every source index is below `sources.length`:\n\n- esbuild 0.25.0: 42 of 44 maps valid\n- esbuild 0.23.1: 44 of 44\n- esbuild 0.28.2: 44 of 44\n\n## Suggested changes\n\n1. Warn or fail when the resolved `esbuild` version falls outside the CLI's declared range. This alone would have surfaced the problem on the first deploy.\n2. Validate emitted sourcemaps before imaging. Checking index bounds is cheap, and the corruption is otherwise invisible until something throws.\n3. Guard `.stack` access in error reporting so a malformed map cannot replace the error being reported.\n\nHappy to open a PR for 1 or 3.\n","author":{"url":"https://github.com/hellno","@type":"Person","name":"hellno"},"datePublished":"2026-08-27T10:00:44Z","url":"https://github.com/triggerdotdev/trigger.dev/issues/4801"}
| 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:0b85450f-2cb6-1557-c480-b7c79a872dcc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CC0C:1F5CA2:36C909:50FCEE:6AFAE228 |
| html-safe-nonce | da345ee01ca6e4c8058971d6829e10ccf23ba1933424ed34df66b3e11cafbb60 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQzBDOjFGNUNBMjozNkM5MDk6NTBGQ0VFOjZBRkFFMjI4IiwidmlzaXRvcl9pZCI6IjM3MDE3MDE2NDg0MjcxODA1ODUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 8756e082ad2500456a0ed43e67c31ad4011e1ab166ae8400f57252707327edfd |
| hovercard-subject-tag | issue:5266286937 |
| 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/4801/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a7144e442e30d67b3451616101b04a3fbd625ac69903e38328d56e582d9a0f25/triggerdotdev/trigger.dev/issues/4801 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a7144e442e30d67b3451616101b04a3fbd625ac69903e38328d56e582d9a0f25/triggerdotdev/trigger.dev/issues/4801 |
| og:image:alt | What happened trigger.dev@4.5.11 declares esbuild ^0.23.0. Our repo had a root-level npm overrides entry pinning esbuild to 0.25.0, added for GHSA-67mh-4wv8-2f99. npm honours the override, so the C... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hellno |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9d9bd51a568909a83d1abb9d6f74d68f0c87ca85fe3a56d3f5d70d8b89add9f2 |
| 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 | 4a7ae932999cc6d511008dbf980ff9efad2a31f7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width