Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot make it to work with SharedWorker #157

Open
pvcnt opened this issue Jul 8, 2024 · 1 comment
Open

Cannot make it to work with SharedWorker #157

pvcnt opened this issue Jul 8, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@pvcnt
Copy link

pvcnt commented Jul 8, 2024

Describe the bug
I am trying to use this plugin with a SharedWorker, and hit the following error:

TypeError: ep.postMessage is not a function
    requestResponseMessage comlink.ts:613
    requestResponseMessage comlink.ts:601
    apply comlink.ts:504

I did some debugging and ep is an instance of SharedWorker, which indeed does not have a postMessage method (ep.port has though).

To Reproduce
I am using the following snippet:

const worker = new ComlinkSharedWorker<typeof import("./worker")>(
    new URL("./worker", import.meta.url), {type: "module"}
);
await worker.refresh();

Expected behavior
It should work.

Desktop (please complete the following information):

  • OS: macOS
  • Browser: Firefox
  • Version [e.g. 22]: 127.0.2
@mathe42 mathe42 self-assigned this Jul 8, 2024
@mathe42 mathe42 added the bug Something isn't working label Jul 8, 2024
@mathe42
Copy link
Owner

mathe42 commented Jul 8, 2024

This is a bug created with my 5.0 refactoring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants