Skip to content
This repository was archived by the owner on Dec 8, 2020. It is now read-only.

Prevent throwing TypeError: Converting circular structure #69

Description

@StephanGeorg

JSON.stringify throws by default "TypeError: Converting circular structure to JSON" in @timberio/node when trying to log context like

const context = {};
context.c = context;

Should handle gracefully with https://github.com/davidmarkclements/fast-safe-stringify to prevent from just throwing by following the protip.

I had this issue by logging an unknown object from a module. Thought it could be an improvement when the library itself is doing such conversion.

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