Breakpoints never bind with Turbopack (Next.js) source maps: bundled source-map 0.7.4 has broken index-map support
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- nextjs, typescript
- Domain
- devtools
Research direction
The fix is a dependency bump: package.json already allows source-map ^0.7.4 to resolve to 0.7.6, so the lockfile is what pins the old version. Change the source-map entry in package-lock.json to 0.7.6 (for example with npm install source-map@^0.7.6), then run the existing build and tests. Do not edit dist/adapter.bundle.js, which is generated output. Done when the lockfile resolves 0.7.6 and the build passes; confirming the breakpoint needs a Turbopack-based Next.js app.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- TypeScript
- Stars
- 446
- Forks
- 77
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from firefox-devtools/vscode-firefox-debug
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
firefox-devtools/vscode-firefox-debug#391 · 2 comments · 1 reaction ·
-
bug path mapping
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
CastleOpen
Difficulty 5/5 Over a week Newbie friendliness 10/100
-
Create new issueOpen
Difficulty 5/5 Over a week Newbie friendliness 1/100
All issues in firefox-devtools/vscode-firefox-debug
Similar issues
-
awaiting-response bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
wildcard/caro#1562 · 1 comment ·
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
supadata-ai/mcp#27 ·
-
content
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
cosimochellini/one-piece-zero-spoiler#516 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
capricorn86/happy-dom#2485 ·
Maintainers usually reply within 2 days
-
lane: fast
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
unicef/adt-studio#946 ·
Maintainers usually reply within 2 days