processing / processing/p5.js-web-editor

If a function prints an object with p5.Graphics object, the function won't print anything else

Open
#3,330 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug
Dominant language
JavaScript
Stars
1.7k
Forks
1.7k
Avg merge
3d 4h
Merged PRs (30d)
8

Description

p5.js version

1.11.1

What is your operating system?

Windows

Web browser and version

Chrome version: 132.0.6834.160

Actual Behavior

The program doesn't log anything, even though draw() calls console.log();

Expected Behavior

The program should log "test" and the obj object every frame.

Steps to reproduce
Steps:
  1. Create object with p5.Graphics object
  2. Try to print something in a function along with the object
Snippet:
let obj = {graphics: null};

function setup() {
  createCanvas(400, 400);
  obj.graphics = createGraphics(400, 400);
}

function draw() {
  background(220);
  console.log("test");
  console.log(obj);
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the provided setup() and draw() snippet in the p5.js Web Editor, using the reported browser and p5.js version. Trace the editor's handling of console.log() when an object contains a p5.Graphics value; done means both "test" and the object are logged on every frame without suppressing other output.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.