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

Worker usage via comlink fails on "MessageChannel is not defined" #11

Open
gthb opened this issue Aug 29, 2021 · 2 comments
Open

Worker usage via comlink fails on "MessageChannel is not defined" #11

gthb opened this issue Aug 29, 2021 · 2 comments

Comments

@gthb
Copy link

gthb commented Aug 29, 2021

I'm using comlink to abstract communications with my worker. When I try out workerloader-jest-transformer, comlink.proxy borks trying to create a MessageChannel:

      at Object.serialize (node_modules/comlink/src/comlink.ts:219:30)
      at toWireValue (node_modules/comlink/src/comlink.ts:498:56)
          at Array.map (<anonymous>)
      at processArguments (node_modules/comlink/src/comlink.ts:468:34)
      at Object.subscribe [as apply] (node_modules/comlink/src/comlink.ts:435:45)
      at ...

... i.e. here: https://github.com/GoogleChromeLabs/comlink/blob/46f79fc257261b68f8987c5e6b9bd635589758df/src/comlink.ts#L219

Presumably MessageChannel needs to be mocked as well?

@astagi
Copy link
Owner

astagi commented Sep 5, 2021

Hi @gthb can you please share your code or a sample that uses MessageChannel and workerloader-jest-transformer to reproduce your problem?

@gthb
Copy link
Author

gthb commented Sep 24, 2021

Hi @astagi, I'm sorry, I'm probably not going to put time into that, as I am not really using workerloader-jest-transformer, I just tried it out briefly in my worker prototype, and wanted to let you know about the snag I hit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants