Skip to content

fix(sea): always load the VFS polyfill instead of node:vfs - #318

Merged
robertsLando merged 1 commit into
mainfrom
fix/sea-prefer-vfs-polyfill
Oct 23, 2026
Merged

robertsLando merged 1 commit into
mainfrom
fix/sea-prefer-vfs-polyfill

Conversation

@robertsLando

Copy link
Copy Markdown
Member

Closes #317

prelude/sea-vfs-setup.js tried require('node:vfs') first and fell back to @roberts_lando/vfs only if that threw. Core node:vfs ignores the mount prefix:

mount('/snapshot', ...) -> /dev/null/vfs/1   // /snapshot exists: false

Today this only happens with --experimental-vfs, but nodejs/node#66318 unflags it, so the first Node release that includes it would break every SEA binary built on it.

This PR drops the node:vfs branch and always loads the polyfill. Making core node:vfs work (capability check or opt-in) is left for a follow-up.

  • prelude/sea-vfs-setup.js: require @roberts_lando/vfs directly.
  • docs/ARCHITECTURE.md: replace the old fallback snippet with why the polyfill is always used.

Tested: yarn build, yarn lint, e2e test-85-sea-enhanced, test-89-sea-fs-ops, test-90-sea-worker-threads on Node 22.

Core node:vfs ignores the mount prefix and mounts at /dev/null/vfs/<n>,
so every /snapshot path fails. Once Node ships vfs unflagged
(nodejs/node#66318) every SEA binary would take that path.

Refs #317
@robertsLando
robertsLando merged commit 28b9fb4 into main Oct 23, 2026
28 checks passed
@robertsLando
robertsLando deleted the fix/sea-prefer-vfs-polyfill branch October 23, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SEA: stop preferring node:vfs before Node.js ships it unflagged

1 participant