You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stream browser console errors to stderr and add a fail-on-error --check mode #213
Feature: stream browser console errors to stderr and fail on error (--check / --strict mode)
Problem
fastled <sketch> compiles, serves, and opens the browser — but runtime failures inside the page are invisible to the terminal. A sketch can ship with the renderer throwing per frame, 404'ing manifest resources, or crashing its worker, and the CLI still reports success. We hit exactly this: the FastLED gfx-core refactor broke the default browser renderer (screenmap: no coordinate strips found thrown every frame in fastled_background_worker.js) plus two manifest 404s, and nothing in the compile-and-serve flow surfaced it (fixed on the FastLED side in FastLED/FastLED#3686).
Proposal
Friction-free error catching in the CLI:
Always stream page diagnostics to stderr while serving: attach to the opened browser tab (CDP — Chrome needs --remote-allow-origins=* for the websocket) or drive a headless page alongside, and forward console.error, uncaught exceptions, failed requests (4xx/5xx), and worker [ERROR] logs to stderr with a clear prefix.
fastled <sketch> --check (or --strict): headless mode that loads the compiled sketch, waits for first frames, and exits non-zero if any console error / page exception / failed resource occurred — CI-friendly, no browser window.
Suggested assertion window: fail fast on the first error after domcontentloaded, with a --check-timeout (default ~20 s) for the frames-rendered success signal (globalThis.fastLEDFrameCount > 0).
Practical CDP notes from building it: screenshot/attach needs --remote-allow-origins=*; --virtual-time-budget hangs the WASM app (audio worklet timers), so wait in real time; worker console messages do propagate to the page console.
Filed from a debugging session on 2026-07-16 where the broken default renderer was only discovered by manually attaching a browser and reading the console.
Activity