processing / processing/p5.js-web-editor

In-editor console is out of sync with canvas and browser console

Open
#3,244 3 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.10.0

What is your operating system?

Mac OS

Web browser and version

Chrome v129.0.6668.90

Actual Behavior

The data displayed in the in-editor console are out of sync with the canvas as well as the browser console. It looks like it might be an off-by-one error somewhere or that the in-editor console is updated last and after a delay of some sort, as I first observed it in a sketch where I had assumed I had made an off-by-one indexing error, but then made a barebones sketch to demonstrate the problem. Also, in the attached screenshots, you can see that the two consoles disagree, while the browser console is in-sync with what is being shown in the canvas.
Screenshot 2024-10-07 at 11 11 33 PM 1
Screenshot 2024-10-07 at 11 11 33 PM

Expected Behavior

I expect the console to be updated in synchrony with the browser console and what is being displayed in the canvas

Steps to reproduce
Steps:
  1. run code 2. observe disagreement between consoles and canvas
Snippet:

function setup() {
  createCanvas(400, 400);
  frameRate(2);
}

function draw() {
  if (frameCount % 2 == 0){
    console.log("black");
    background(0);
  }
  else{
    console.log("white");
    background(255);
  }
}

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

Run the linked barebones sketch and compare the in-editor console, browser console, and canvas while observing setup() and draw(). Trace how the editor displays console output relative to frameCount and rendering; done means all three consistently show the same frame's result without a delay or off-by-one mismatch.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.