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
| typeof window !== 'undefined' && | ||
| /* checks for electron processes */ | ||
| !window.process && | ||
| !window.process?.['type'] |
Contributor
There was a problem hiding this comment.
!window.process?.['type'] is redundant here
Since the previous condition already implies that window.process would be undefined
Contributor
Author
There was a problem hiding this comment.
It mirrors DKG, will have to clean both of it together as a follow-up
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>
1e9904e to
e7bdb1c
Compare
vibhavgo
approved these changes
Jun 29, 2026
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