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

#<Module> could not be cloned #4

Closed
mshavliuk opened this issue Nov 17, 2017 · 7 comments
Closed

#<Module> could not be cloned #4

mshavliuk opened this issue Nov 17, 2017 · 7 comments

Comments

@mshavliuk
Copy link

mshavliuk commented Nov 17, 2017

When I try to execute scripts at this demo page I see the next errors:

Uncaught (in promise) DOMException: Failed to execute 'postMessage' on 'Worker': #<Module> could not be cloned.
    at fetch.then.then.then.mod (https://mdn.github.io/webassembly-examples/js-api-examples/index-compile.html:19:16)
    at <anonymous>
fetch.then.then.then.mod @ index-compile.html:19
Promise resolved (async)
(anonymous) @ index-compile.html:18

My browser is Chrome 62.0.3202.89

@lukewagner
Copy link
Contributor

Chrome hasn't implemented this yet.

@JianmingXia
Copy link

What browser support?

@Kagami
Copy link

Kagami commented Feb 13, 2018

It's behind the WebAssembly structured cloning support flag in latest Chrome. Seems like it's not enabled by default due to:
WebAssembly/design#972
WebAssembly/design#956
WebAssembly/design#1048

Kinda embarassing that MDN recommends to cache WebAssembly in docs while this is not fully managed yet and seems to work only in FF…

@chrisdavidmills
Copy link
Contributor

@lukewagner what do you think we should do about this?

@lukewagner
Copy link
Contributor

The Chrome folks did have objections, initially, but I think those have been addressed (by restricting where a Module can be postMessaged too), so I'm not aware of what is holding them back from enabling this feature. @flagxor?

Edge has also shipped structured clone support and, e.g., the MDN demo works in Edge release. Safari doesn't support structured clone, yet, though,.

Anyhow, makes sense to put up the usual compatibility chart. When this was written, I was expecting structured cloning to ship in all browsers' initial wasm release, but that didn't end up happening.

@chrisdavidmills
Copy link
Contributor

I've added a browser support section to the article in question:

https://developer.mozilla.org/en-US/docs/WebAssembly/Caching_modules#Browser_support

I need to think about how to add this to our browser compat data repo first before creating one of the proper charts.

@caugner caugner added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Oct 10, 2023
@caugner
Copy link

caugner commented Oct 11, 2023

Verified that the example is now working in Chrome 117, Firefox 120 (Nightly) and Safari 17.0, i.e. I'm seeing some console output, so I'm closing this issue as resolved.

structuredClone() landed in Chrome 98 (Feb 2022), so this might have resolved it.

@caugner caugner closed this as completed Oct 11, 2023
@caugner caugner removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Oct 11, 2023
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

6 participants