Skip to content

sea: add source maps for SEA with VFS - #67503

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
mcollina:sea-vfs-sourcemaps
Nov 18, 2026
Merged

nodejs-github-bot merged 1 commit into
nodejs:mainfrom
mcollina:sea-vfs-sourcemaps

Conversation

@mcollina

@mcollina mcollina commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Adds source-map support for single executable applications built with
"useVfs": true, so .map files and original sources bundled as assets (or
in the "vfsArchive" archive) are read through the virtual file system and
applied to stack traces, module.findSourceMap(), and the error source
preview above an uncaught error.

Adds two tests covering the inline-assets and zip-archive VFS paths, each
asserting that the source map resolves against the mount point and that a
thrown error's frame and source line are remapped to the original source.
Also documents enabling source maps in a SEA and bundling the maps.


AI generated, reviewed by me.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/single-executable

@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Nov 15, 2026
@mcollina
mcollina force-pushed the sea-vfs-sourcemaps branch 2 times, most recently from f3b744e to ffb2393 Compare November 16, 2026 08:59
@mcollina
mcollina requested a review from pipobscure November 16, 2026 09:14
@mcollina
mcollina marked this pull request as ready for review November 16, 2026 09:14
SEA binaries built with "useVfs" can now load source maps from the
bundled assets (or the "vfsArchive" archive) and apply them to stack
traces and error output, because fs reads are routed through the virtual
file system mounted by the SEA.

Add two tests covering the inline-assets and zip-archive VFS paths, each
asserting that findSourceMap() resolves against the mount point and that
a thrown error's frame and source line are remapped to the original
source. Also document how to enable and bundle source maps in a SEA.

Signed-off-by: Matteo Collina <matteo.collina@gmail.com>
@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 16, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 16, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@codecov

codecov Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.67%. Comparing base (ab476ec) to head (9d786b9).
⚠️ Report is 65 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67503      +/-   ##
==========================================
- Coverage   90.68%   90.67%   -0.01%     
==========================================
  Files         799      799              
  Lines      280246   280252       +6     
  Branches    54113    54128      +15     
==========================================
- Hits       254150   254129      -21     
- Misses      16234    16242       +8     
- Partials     9862     9881      +19     

see 34 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mcollina mcollina added the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Nov 16, 2026
@github-actions github-actions Bot removed the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Nov 16, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@mcollina mcollina added the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 18, 2026
@nodejs-github-bot nodejs-github-bot added the lacks-second-approval Commit Queue PRs awaiting a second collaborator approval or completion of the required wait. label Nov 18, 2026
@jasnell jasnell added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 18, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 273f217 into nodejs:main Nov 18, 2026
76 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 273f217

@nodejs-github-bot nodejs-github-bot removed commit-queue PRs queued for automated landing through the Commit Queue. lacks-second-approval Commit Queue PRs awaiting a second collaborator approval or completion of the required wait. labels Nov 18, 2026
aduh95 pushed a commit that referenced this pull request Nov 19, 2026
SEA binaries built with "useVfs" can now load source maps from the
bundled assets (or the "vfsArchive" archive) and apply them to stack
traces and error output, because fs reads are routed through the virtual
file system mounted by the SEA.

Add two tests covering the inline-assets and zip-archive VFS paths, each
asserting that findSourceMap() resolves against the mount point and that
a thrown error's frame and source line are remapped to the original
source. Also document how to enable and bundle source maps in a SEA.

Signed-off-by: Matteo Collina <matteo.collina@gmail.com>
PR-URL: #67503
Reviewed-By: Philipp Dunkel <pip@pipobscure.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants