Skip to content

Node.js allows the structedClone of objects that do "not have a transferable type." #54602

Closed
@avivkeller

Description

@avivkeller

The structuredClone function in JavaScript behaves differently in Node.js and web browsers when cloning a Blob object with the transfer option. In Node.js, the Blob is cloned successfully, while in web browsers, a DataCloneError is thrown. This discrepancy is causing the web platform tests in #54468 to fail.

const blob = new Blob();
console.log(structuredClone(blob, { transfer: [blob] }));
  • Node.js Behavior: Successful cloning of the Blob
  • Web Browser Behavior: Uncaught DataCloneError: Failed to execute 'structuredClone' on 'Window': Value at index 0 does not have a transferable type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    web-standardsIssues and PRs related to Web APIs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions