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

DOMException: Failed to execute 'postMessage' on 'Worker': Value at index 0 does not have a transferable type. #667

Open
vusirikala opened this issue Aug 22, 2022 · 1 comment

Comments

@vusirikala
Copy link

I tried to add

import { MediaRecorder, register } from 'extendable-media-recorder';
import { connect } from 'extendable-media-recorder-wav-encoder';

await register(await connect());

It gives me the following error.

module.ts:67 Uncaught (in promise) DOMException: Failed to execute 'postMessage' on 'Worker': Value at index 0 does not have a transferable type.
    at http://localhost:3000/static/js/bundle.js:17017:18
    at new Promise (<anonymous>)
    at call (http://localhost:3000/static/js/bundle.js:17004:14)
    at http://localhost:3000/static/js/bundle.js:26443:14
    at register (http://localhost:3000/static/js/bundle.js:20911:89)
    at reg (http://localhost:3000/static/js/bundle.js:836:76)
    at ./src/index.js (http://localhost:3000/static/js/bundle.js:839:1)
    at options.factory (http://localhost:3000/static/js/bundle.js:91182:31)
    at __webpack_require__ (http://localhost:3000/static/js/bundle.js:90627:33)
    at http://localhost:3000/static/js/bundle.js:91764:37

Based on the call stack, the register function in extendable-media-recorder called media-encoder-host-broker/src/module.ts:36, which called broker-factory/src/module.ts:59, which called broker-factory/src/module.ts:57. And this line gave error.

I kindly request you to help me fixing this.

@chrisguttandin
Copy link
Owner

Hi @vusirikala,

from your description I would guess the error is coming from here: https://github.com/chrisguttandin/media-encoder-host-broker/blob/e92fb44e0cfa4da3b1830b9302559724ce2bf8a2/src/module.ts#L36

It's where postMessage() is used internally to transfer the port to the worker. It looks like port is not a MessagePort for some reason.

Can you try to log the following:

import { register } from 'extendable-media-recorder';
import { connect } from 'extendable-media-recorder-wav-encoder';

const port = await connect();

console.log(port);

await register(port);

I'm curious what port actually is.

It would also be helpful to know which browser you're using? Or is it happening in multiple browser?

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