Skip to content

Error objects are serialized to {} #135

Open
@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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions