Skip to content

Cannot console.log objects having circular references #3178

Open
@dipamsen

Description

@dipamsen

p5.js version

1.9.4

What is your operating system?

Windows

Web browser and version

Chrome 126.0.6478.127

Actual Behavior

Printing a p5.Image object breaks the console.

Expected Behavior

p5.Image should be printable.

Steps to reproduce

Steps:

  1. Copy the following code in a sketch
  2. Running the code prints nothing on the console
  3. Commenting out the third line prints "Hi".

Snippet:

let img = createImage(20, 20);
console.log("Hi");
console.log(img);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions