Skip to content

Commit 014ee99

Browse files
Marzooqaclaude
andcommitted
fix(sdk-lib-mpc): use direct dist path for wasm-mps/web import
TypeScript moduleResolution:node cannot resolve package.json subpath exports like @bitgo/wasm-mps/web. Use the direct file path @bitgo/wasm-mps/dist/web/js/wasm/wasm_mps for both the type reference and the dynamic import so tsc resolves it under all moduleResolution settings. Ticket: WCI-251 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 31a0c68 commit 014ee99

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

  • modules/sdk-lib-mpc/src/tss/eddsa-mps

modules/sdk-lib-mpc/src/tss/eddsa-mps/dkg.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import crypto from 'crypto';
44
import { DeserializedMessage, DeserializedMessages, DkgState, EddsaReducedKeyShare } from './types';
55

66
type NodeWasmer = typeof import('@bitgo/wasm-mps');
7-
type WebWasmer = typeof import('@bitgo/wasm-mps/web');
7+
// eslint-disable-next-line import/no-internal-modules -- direct path needed for moduleResolution:node compat
8+
type WebWasmer = typeof import('@bitgo/wasm-mps/dist/web/js/wasm/wasm_mps');
89
type WasmMps = NodeWasmer | WebWasmer;
910

1011
/**
@@ -62,8 +63,8 @@ export class DKG {
6263
!window.process?.['type']
6364
) {
6465
// Browser: web build has explicit init() — guaranteed ready after await
65-
// eslint-disable-next-line import/no-internal-modules -- @bitgo/wasm-mps exposes environment-specific subpath exports.
66-
const webWasm = await import('@bitgo/wasm-mps/web');
66+
// eslint-disable-next-line import/no-internal-modules -- direct path needed for moduleResolution:node compat
67+
const webWasm = await import('@bitgo/wasm-mps/dist/web/js/wasm/wasm_mps');
6768
await webWasm.default();
6869
this.wasmMps = webWasm;
6970
} else {

0 commit comments

Comments
 (0)