CLI accepts an esbuild version outside its declared range, producing corrupt sourcemaps
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- node.js, typescript
- 领域
- backend, build-system
调研方向
Start by tracing the loadConfig → buildWorker build path and the esbuild version resolved under npm overrides; the report compares emitted sourcemaps across esbuild versions. Then read entryPoints/managed-run-worker.js and otel/utils.ts for the stack-handling impact. Done means addressing a clearly chosen safeguard and verifying it against the reported reproduction, including sourcemap index bounds if validation is chosen.
由索引模型根据 Issue 内容生成。
描述
What happened
[email protected] 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.
esbuild 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:
trigger/slack-attention-agent.mjs.map: 6sources, mappings referencing index 37- a shared
aichunk: 171sources, mappings referencing index 200
Impact
The 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.
Every 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.
Reproduction
Trigger project on runtime: node-22 with [email protected] and @ai-sdk/[email protected], 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:
- esbuild 0.25.0: 42 of 44 maps valid
- esbuild 0.23.1: 44 of 44
- esbuild 0.28.2: 44 of 44
Suggested changes
- Warn or fail when the resolved
esbuildversion falls outside the CLI's declared range. This alone would have surfaced the problem on the first deploy. - Validate emitted sourcemaps before imaging. Checking index bounds is cheap, and the corruption is otherwise invisible until something throws.
- Guard
.stackaccess in error reporting so a malformed map cannot replace the error being reported.
Happy to open a PR for 1 or 3.
- 主要语言
- TypeScript
- 星标
- 16.5k
- 派生
- 1.5k
- 平均合并
- 1 天 15 小时
- 30 天内合并 PR
- 17
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
triggerdotdev/trigger.dev 的其他 Issue
-
bug: retry.fetch ignores the caller's abort signal and retries aborted requests可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
triggerdotdev/trigger.dev#5116 · 2 条评论 ·
维护者通常 1 天内回复
-
bug: Chat transport crashes on Safari < 17.4: AbortSignal.any is not a function可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 83/100
triggerdotdev/trigger.dev#5098 · 2 条评论 ·
维护者通常 1 天内回复
-
bug: Side menu items lose their active state on detail pages可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
triggerdotdev/trigger.dev#5088 ·
维护者通常 1 天内回复
-
bug: RBAC loader logs "plugin found but failed to load" when @triggerdotdev/plugins is simply not installed可能重新可做 @itsfaryal 于 17 天前认领,目前没有进行中的 PR。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
triggerdotdev/trigger.dev#5083 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
triggerdotdev/trigger.dev#5072 · 1 条评论 ·
维护者通常 1 天内回复
查看 triggerdotdev/trigger.dev 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
bug platform-android
难度 2/5 1-3 小时 新手友好度 68/100
Termix-SSH/Mobile#146 · 1 条评论 ·
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 66/100
devswha/herdr-web-ui#3875 ·
-
难度 1/5 1 小时以内 新手友好度 88/100
-
area: runtime chore cli consistency dependencies developer-experience difficulty: easy discovery documentation enhancement good first issue help wanted hygiene json-output packaging priority: P3 tests version
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复