Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Breakpoints never bind with Turbopack (Next.js) source maps: bundled source-map 0.7.4 has broken index-map support

未关闭 适合新手
#401 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 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
  1. Run a Next.js app with the Turbopack dev server (next dev).
  2. Launch it with a "type": "firefox", "request": "launch" config.
  3. 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]:

  1. computeColumnSpans() is missing. getAllBreakables() calls sourceMappingInfo.computeColumnSpans(), which calls sourceMapConsumer.computeColumnSpansOn an index map that throws TypeError`, which is swallowed in the ase breakpoint is never set.
  2. _parseMappings() drops each mapping's source. It calls util.computeSourceURL(section.consumer.sourceRoot, null, this._sourceMapURL) with null instead of the mapping's source. Every mapping is therefore attributed to the source-map URL, eachMapping never 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 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

firefox-devtools/vscode-firefox-debug 的其他 Issue

查看 firefox-devtools/vscode-firefox-debug 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。