home/ atoms/ p5live-silent-visual-bugs

Many p5.js bugs produce no exception and manifest only as wrong canvas output

Unlike syntax errors, several common p5.js mistakes never throw a JavaScript exception. Missing background() causes trails or blobs because each draw() call accumulates without clearing. A leaked transform (translate/rotate without push/pop) compounds each frame, producing runaway drift. An undefined font silently produces no text output. Wrong audio analyser wiring leaves reactivity frozen at zero. None of these fire an error; diagnosis requires reasoning about the canvas appearance and the draw() call order, not reading an error message.

Examples

Forget background(0) in draw() — the canvas fills with overlapping shapes from every frame. Add translate(10, 0) without push/pop — the origin drifts rightward each frame without stopping.

Assessment

List three p5.js bugs that do not throw a JavaScript exception, describe how each manifests visually, and give the one-line fix for each.

“Many p5 failures **don't throw**: a missing `background()` (trails/blob), a leaked transform (runaway spin),”
context/ · L5-debug/p5live.md · chunk 1