CLI accepts an esbuild version outside its declared range, producing corrupt sourcemaps
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 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時間
- マージ済み PR(30日)
- 17
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
triggerdotdev/trigger.dev のほかの issue
-
bug: retry.fetch ignores the caller's abort signal and retries aborted requests再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 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再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
triggerdotdev/trigger.dev#5098 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
bug: Side menu items lose their active state on detail pages再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 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 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 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 日以内に返信