Skip to content

structuredClone and postMessage reject Error objects #5279

@Monti-27

Description

@Monti-27

Both structuredClone and postMessage currently reject Error objects.

I was able to reproduce this on current main.

structuredClone(new Error('boom')) throws TypeError: Errors are not supported yet.

postMessage(new Error('boom')) fails for the same reason, since both paths go through JsValueStore.

This looks like a real gap in the structured clone path, not just missing API wiring. ValueStoreInner already has an Error variant, but the store still rejects Error objects on the way in and does not reconstruct them on the way out.

Relevant files:

  1. core/runtime/src/store/from.rs
  2. core/runtime/src/store/to.rs
  3. core/runtime/src/store/mod.rs

Expected behavior is for Error objects to be cloned through the same path instead of failing at serialization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions