Skip to content

Unable to log circular objects with functions #437

Closed
@marvinhagemeister

Description

@marvinhagemeister

Logging an object with a circular reference works for as long as no property points to a function.

Without any function it works fine:

const a = { type: null, foo: 123 }
a.foo = a;
console.log(a);

...but when a function is present it fails.

const Foo = () => null;
const obj = { type: Foo, foo: null };
obj.foo = obj;
console.log(obj);

Error message:

Error while collecting browser logs: Evaluation failed: TypeError: Converting circular structure to JSON
          --> starting at object with constructor 'Window'
          --- property 'self' closes the circle
          at JSON.stringify (<anonymous>)
          at Object.serialize (<anonymous>:103:17)
          at __puppeteer_evaluation_script__:2:47

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