diff --git a/packages/php-wasm/web/src/lib/api.ts b/packages/php-wasm/web/src/lib/api.ts index ce1632106e..ea92562533 100644 --- a/packages/php-wasm/web/src/lib/api.ts +++ b/packages/php-wasm/web/src/lib/api.ts @@ -22,7 +22,9 @@ export function consumeAPI( setupTransferHandlers(); const endpoint = - remote instanceof Worker ? remote : Comlink.windowEndpoint(remote); + remote instanceof Worker + ? remote + : Comlink.windowEndpoint(remote, context); /** * This shouldn't be necessary, but Comlink doesn't seem to @@ -33,7 +35,7 @@ export function consumeAPI( * * @TODO: Remove this workaround. */ - const api = Comlink.wrap(endpoint, context); + const api = Comlink.wrap(endpoint); const methods = proxyClone(api); return new Proxy(methods, { get: (target, prop) => {