comlink
comlink copied to clipboard
Unserializable return type error
When an unserializable type is returned such as a function, this results in an uncaught error. In Deno, this crashes the application. This change catches the error and returns a serialized error type so that it can be handled by the calling thread.
According to the MDN, there are currently two types of objects that do not work with the structured clone algorithm and will result in a DataCloneError: "a function" and "a DOM node".
Please re-scan.
Do you mind adding a test for this as well?
@surma Sure, I added it at the end of "same_window.comlink.test.js".
@surma Good evening sir, just checking the status on this PR. is there anything else that you need from me before merging? thanks.
+1. I'm having the same issue.
This looks great, if you wouldn't mind running npm run fmt on the PR to get the formatting fixed I'd be happy to merge for the next version.
This looks great, if you wouldn't mind running
npm run fmton the PR to get the formatting fixed I'd be happy to merge for the next version.
Awesome. Will do as soon as I get to my computer later today.
@benjamind I have rebased the main branch on my fork and have also ran npm run fmt. :)
Thanks!
Thanks!
Anytime!