-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Open
Labels
docIssues and PRs related to the documentations.Issues and PRs related to the documentations.
Description
Affected URL(s)
Description of the problem
The following code is supposed to print {}:
const { port1, port2 } = new MessageChannel();
port1.onmessage = ({ data }) => console.log(data);
port2.postMessage(new URL('https://example.org'));
// Prints: { } However, when running it, it gives the following:
node:internal/per_context/domexception:76
const self = new Error();
^
DOMException [DataCloneError]: Cannot clone object of unsupported type.
at new DOMException (node:internal/per_context/domexception:76:18)
at file:///my-folder-structure/test.mjs:6:7
at ModuleJob.run (node:internal/modules/esm/module_job:377:25)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:691:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:101:5)
Metadata
Metadata
Assignees
Labels
docIssues and PRs related to the documentations.Issues and PRs related to the documentations.