Skip to content

Stream browser console errors to stderr and add a fail-on-error --check mode #213

Closed

Description

@zackees

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:

  1. 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.
  2. 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.
  3. 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).

Prior art / reference implementation

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions