fix(sdk-lib-mpc): lazy-load wasm-mps to fix browser DSG#9132
Open
Marzooqa wants to merge 1 commit into
Open
Conversation
Contributor
f64215a to
1e9904e
Compare
vibhavgo
reviewed
Jun 29, 2026
vibhavgo
reviewed
Jun 29, 2026
1e9904e to
e7bdb1c
Compare
vibhavgo
previously approved these changes
Jun 29, 2026
danielpeng1
reviewed
Jun 30, 2026
danielpeng1
left a comment
Contributor
There was a problem hiding this comment.
Looks good; only small comments
Also since asyncifying is technically a breaking change should we explicitly note that callers must now await these methods (via merge commit message, which updates CHANGELOG.mds for respective modules)?
danielpeng1
reviewed
Jun 30, 2026
Static top-level import compiled to synchronous require() in CJS, causing fs.readFileSync at module init — unavailable in browser. DSG failed with: Cannot read properties of undefined (reading '__wbindgen_add_to_stack_pointer') Mirrors the lazy-load pattern from WCI-244 (DKG fix): - Browser: await import('@bitgo/wasm-mps/web') + webWasm.default() - Node: await import('@bitgo/wasm-mps') - initDsg() and restoreSession() made async - eddsaMPCv2.ts call sites updated to await initDsg() - Tests updated accordingly WCI-866 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
e7bdb1c to
8e65cb9
Compare
danielpeng1
approved these changes
Jun 30, 2026
pranavjain97
approved these changes
Jun 30, 2026
pranavjain97
left a comment
Contributor
There was a problem hiding this comment.
lgtm, one small thing
| if ( | ||
| typeof window !== 'undefined' && | ||
| /* checks for electron processes */ | ||
| !window.process && |
Contributor
There was a problem hiding this comment.
wouldn't an Electron renderer where window.process is set take the browser wasm path here? !window.process is false so the type check never runs.
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.
Static top-level import compiled to synchronous require() in CJS, causing fs.readFileSync at module init — unavailable in browser. DSG failed with: Cannot read properties of undefined (reading '__wbindgen_add_to_stack_pointer')
Similar to the lazy-load pattern from DKG fix:
WCI-866