Skip to content

Error objects are serialized to {} #135

@wujekbogdan

Description

@wujekbogdan

When I do:

import serializeJavascript from 'serialize-javascript';
const serialized = serializeJavascript({  error: new Error('message') });

console.log(serialized);

I'm receiving:

"{\"error\":{}}"

Is it intentional or is it a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions