Breakpoints never bind with Turbopack (Next.js) source maps: bundled source-map 0.7.4 has broken index-map support
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- nextjs, typescript
- 领域
- devtools
调研方向
修复方式是升级依赖:package.json 已允许 source-map ^0.7.4 解析到 0.7.6,因此是 lockfile 锁定了旧版本。将 package-lock.json 中的 source-map 条目改为 0.7.6(例如运行 npm install source-map@^0.7.6),然后运行现有的构建和测试。不要编辑 dist/adapter.bundle.js,它是生成的输出。当 lockfile 解析到 0.7.6 且构建通过时即完成;确认断点需要一个基于 Turbopack 的 Next.js 应用。
由索引模型根据 Issue 内容生成。
描述
Summary
Breakpoints in apps built with Turbopack (Next.js dev server) stay unbound. Turbopack emits index source maps (a top-level sections array), and [email protected], the version pinned in package-lock.json, has two bugs in IndexedSourceMapConsumer that stop the adapter from computing any breakable locations. Both are fixed in [email protected].
Environment
- vscode-firefox-debug 2.15.0
- Firefox Developer Edition 158.0
- Next.js 16.3.6 (Turbopack dev server)
- macOS 26.6.2
- VS Code 1.141.0
Steps to reproduce
- Run a Next.js app with the Turbopack dev server (
next dev). - Launch it with a
"type": "firefox","request": "launch"config. - Set a breakpoint in any app source file and load the page that uses it.
Expected: the breakpoint binds.
Actual: it stays unbound. The source does load and maps to the right local path (SourcesManager: Adding source … / PathConversion: Converted url file:///…), but no getBreakpointPositionsCompressed / setBreakpoint requests are ever sent, and no error is logged.
Root cause
Both bugs are in IndexedSourceMapConsumer in [email protected]:
computeColumnSpans()is missing.getAllBreakables()callssourceMappingInfo.computeColumnSpans(), which callssourceMapConsumer.computeColumnSpansOn an index map that throwsTypeError`, which is swallowed in the ase breakpoint is never set._parseMappings()drops each mapping's source. It callsutil.computeSourceURL(section.consumer.sourceRoot, null, this._sourceMapURL)withnullinstead of the mapping's source. Every mapping is therefore attributed to the source-map URL,eachMappingnever yields a mapping for the original file, and the computed breakable ranges are empty.
[email protected] adds IndexedSourceMapConsumer#computeColumnSpans and fixes the source attribution.
Proposed fix
Bump source-map to ^0.7.6 in package.json and update package-lock.json. The current range ^0.7.4 already allows 0.7.6; only the lockfile pins 0.7.4.
Local workaround (verified)
Patching these two spots in dist/adapter.bundle.js (2.15.0) makes brrectly in Turbopack code:
-(this.sourceMapConsumer.computeColumnSpans(),this.columnSpansComputed=!0)
+("function"==typeof this.sourceMapConsumer.computeColumnSpans&&this.sourceMapConsumer.computeColumnSpans(),this.columnSpansComputed=!0)
-let a=n.computeSourceURL(e.consumer.sourceRoot,null,this._sourceMapURL);
+let a=n.computeSourceURL(e.consumer.sourceRoot,o.source,this._source
Then run Developer: Reload Window.
- 主要语言
- TypeScript
- 星标
- 445
- 派生
- 77
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
firefox-devtools/vscode-firefox-debug 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 64/100
firefox-devtools/vscode-firefox-debug#391 · 2 条评论 · 1 个 reaction ·
-
bug path mapping
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 3/5 1-2 天 新手友好度 35/100
-
Castle未关闭
难度 5/5 一周以上 新手友好度 10/100
-
Create new issue未关闭
难度 5/5 一周以上 新手友好度 1/100
查看 firefox-devtools/vscode-firefox-debug 的全部 Issue
相似的 Issue
-
check:passed streams:add
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 1 天内回复
-
area:agents area:cost bug platform:macos
难度 2/5 1-3 小时 新手友好度 77/100
anthropics/claude-code#105375 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 79/100
-
难度 2/5 1-3 小时 新手友好度 79/100
galaxyproject/loom#616 ·
维护者通常 1 天内回复
-
e2e-failure ready-to-code
难度 2/5 1-3 小时 新手友好度 79/100
redhat-developer/rhdh-plugin-export-overlays#4580 · 1 条评论 ·
维护者通常 1 天内回复