Repository navigation
fix(js): return WasmerError from sync filesystem calls - #554
Open
owen-harborcoat wants to merge 1 commit into
Open
owen-harborcoat wants to merge 1 commit into
owen-harborcoat wants to merge 1 commit into
Conversation
stat, readDir, mkdir and remove are synchronous in the core, so rethrow(this.#core.x(...)) evaluated the throwing call before rethrow could catch it. They rejected with a plain Error named WasmerError, which WasmerError.is() does not recognise. Use rethrowSync for them.
owen-harborcoat
force-pushed
the
fix/fs-sync-errors
branch
from
November 9, 2026 05:30
d7ce04d to
1a230d6
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SandboxFileSystem.stat,readDir,mkdirandremovecall methods that are synchronous in the core, sorethrow(this.#core.stat(path))throws beforerethrowgets to catch anything. Callers get a plainErrorwithname: "WasmerError"and acode, andWasmerError.is()returns false for it.readFile,writeFileandrenameare async in the core and were fine.Switched the four to
rethrowSync, and added a check after the existing fs round trip inruntime.test.mjs.I couldn't build the wasm locally, so I tested by applying the same change to the published 0.19.1
dist/index.js. The new assertions fail 4/4 without it and pass with it. Seen on 0.18.0, 0.19.0 and 0.19.1, Node 24 on Windows and Node 22/24 on Linux CI.🤖 Generated with Claude Code