Local-dev step stack traces: wrong lines, and function names that depend on step-executor.ts line offsets
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript, vite
- Lĩnh vực
- developer-experience, testing, tooling
Hướng nghiên cứu
The issue is in the SWC transform configuration in packages/builders/src/apply-swc-transform.ts where sourceMaps: false. The failing tests are in packages/core/e2e/e2e.test.ts under 'basic step error preserves message and stack trace' and 'cross-file step error preserves message and function names in stack'. Start by enabling source maps inline to see the correct positions and the doubled path issue. Then trace how the source map is passed to the esbuild step bundle and how function names are resolved in the dev SSR runner. 'Done' is when the tests pass regardless of line offsets in packages/core/src/runtime/step-executor.ts.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The E2E Local Dev Tests step-error assertions (packages/core/e2e/e2e.test.ts, "basic step error preserves message and stack trace" and "cross-file step error preserves message and function names in stack") pass or fail depending on unrelated line offsets in packages/core/src/runtime/step-executor.ts. On current main they pass by coincidence.
Reproduction (sveltekit, pnpm dev, same env as the CI job)
main@2694663ae: pass. The reported frame isat errorStepFn (workbench/example/workflows/99_e2e.ts:992:11), so the name is right, but the line isn't:errorStepFnthrows at line 1424.main+ five comment-only lines inserted instep-executor.tsabove the step call (// inert×5 beforeconst createEventinexecuteStep): both tests fail. The frame becomesat _a (…/99_e2e.ts:992:11), and the cross-file test reportsat _a (…/helpers.ts:21:22).dev.test.tsisn't needed to trigger it, and it happens with bothWORKFLOW_VM=nodeandquickjs.- CI hit the same thing on all four astro/sveltekit × node/quickjs local-dev jobs of vercel/workflow#4348, whose first revision added five lines to that function. On CI's retry, the name moved to a different wrong function (
hookGetConflictWithPriorStepWorkflow).
What's going on
- Positions:
packages/builders/src/apply-swc-transform.tsruns the SWC transform withsourceMaps: false, with a TODO to investigate. Step-bundle positions therefore point into the transformed code instead of the original file. That's why every step frame reads99_e2e.ts:992whatever the throw site is.- As an experiment,
sourceMaps: 'inline'makes the position correct (99_e2e.ts:1424:9). - It also doubles the path (
workbench/example/workflows/example/workflows/99_e2e.ts), so the source paths in the map need fixing too.
- As an experiment,
- Names: with (1) fixed, the name is still
_a. The frame name comes from source-map name resolution rather than from V8's function name. For Node's--enable-source-maps, that's the enclosing-function or caller-site entry in the map, plus Vite's SSR module runner for eval'd modules. So an offset in how those positions are looked up makes the name depend on where code lands instep-executor.ts.
Impact
Any PR that shifts lines in step-executor.ts can fail these four required jobs for reasons unrelated to its change. Separately, dev-mode step stacks report wrong lines today.
Suggested fix
Emit and chain the SWC transform's source map into the esbuild step bundle, fixing the sources paths. Then check how function names are resolved for step frames in the dev SSR runner, or have the test assert on the frame position instead of relying on the source-map name.
🤖 Generated with Claude Code
- Ngôn ngữ chính
- TypeScript
- Star
- 2.5k
- Fork
- 401
- Merge trung bình
- 1 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 201
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của vercel/workflow
-
getPortLazy re-runs OS port discovery on every call when it finds no portCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
node-module-esbuild-plugin: getImportedIdentifier only checks the first named import when locating a violationCó thể đã có người làm @div-cowboy đã nhận 5 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
vercel/workflow#5057 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
code-transform.mdx §ID Generation omits the package-shipped `name@version` ID formCó thể đã có người làm @Mohith26 đã nhận 113 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của vercel/workflow
Issue tương tự
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 87/100
Maintainer thường phản hồi trong vòng 1 ngày
-
🛠️ dette technique
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 61/100
betagouv/mon-entreprise#4752 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 5 ngày
-
type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
franciscoBSalgueiro/en-croissant#1111 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area/providers type/feature version/v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
anomalyco/opencode#64845 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày