Skip to content

fix(engine): suppress font-loading 404 noise in render console output#195

Merged
vanceingalls merged 3 commits into
mainfrom
fix/render-suppress-font-404-noise
Apr 2, 2026
Merged

fix(engine): suppress font-loading 404 noise in render console output#195
vanceingalls merged 3 commits into
mainfrom
fix/render-suppress-font-404-noise

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Apr 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Filters "Failed to load resource" console errors from render output. These 404s come from font @import URLs that the deterministic font compiler replaces with embedded base64 — the original URLs 404 harmlessly but spam every render with 4+ error lines.

The validate command already has this exact filter (validate.ts:104). This applies the same pattern to the render engine.

Part 3 of 5 in a stacked PR series fixing E2E test findings.

Test plan

  • Render any composition — no more "Failed to load resource: 404" lines in output
  • Real browser errors (e.g., gsap is not defined) still appear

Comment thread packages/engine/src/services/frameCapture.ts Outdated
@miguel-heygen miguel-heygen force-pushed the fix/render-suppress-font-404-noise branch 2 times, most recently from 5a3e099 to f4a4d76 Compare April 2, 2026 16:46

@vanceingalls vanceingalls left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review feedback — requesting changes

Critical: Error filter is too broad
The current filter in packages/engine/src/services/frameCapture.ts:

if (type === "error" && text.startsWith("Failed to load resource")) return;

This suppresses ALL "Failed to load resource" errors, not just font 404s. A missing image, video, or script during rendering would be silently swallowed. This could mask real bugs.

Narrow to font-specific patterns:

if (type === "error" && text.startsWith("Failed to load resource") && 
    /fonts\.googleapis|fonts\.gstatic|\.woff2?/i.test(text)) return;

Or at minimum match only 404 status + known font CDN domains.

@miguel-heygen miguel-heygen force-pushed the fix/render-suppress-font-404-noise branch from 040c458 to f81757e Compare April 2, 2026 17:03
@miguel-heygen miguel-heygen force-pushed the fix/cli-info-resolution-update-check branch from 2a564cf to 096f09b Compare April 2, 2026 17:03
@miguel-heygen

Copy link
Copy Markdown
Collaborator Author

Fixed. Narrowed the filter to match only font-specific 404s:

const isFontLoadError =
  type === "error" &&
  text.startsWith("Failed to load resource") &&
  /fonts\.googleapis|fonts\.gstatic|\.woff2?(\b|$)/i.test(text);

This catches font CDN domains (fonts.googleapis.com, fonts.gstatic.com) and .woff/.woff2 file extensions. Missing images, scripts, and videos will still surface as [Browser:ERROR] in render output. Font 404s still go into browserConsoleBuffer for diagnostics.

@vanceingalls vanceingalls force-pushed the fix/cli-info-resolution-update-check branch 2 times, most recently from 806f008 to 0694b9e Compare April 2, 2026 21:10
@vanceingalls vanceingalls force-pushed the fix/render-suppress-font-404-noise branch from f81757e to 36582e6 Compare April 2, 2026 21:10
@vanceingalls vanceingalls changed the base branch from fix/cli-info-resolution-update-check to graphite-base/195 April 2, 2026 21:12
miguel-heygen and others added 2 commits April 2, 2026 21:13
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ssing

Address review feedback: instead of silently dropping "Failed to load
resource" errors (which could hide real asset failures), keep them in
browserConsoleBuffer for diagnostics but don't print to stdout. Real
asset 404s are still caught by the file server's own logging.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vanceingalls vanceingalls force-pushed the fix/render-suppress-font-404-noise branch from 36582e6 to e76e312 Compare April 2, 2026 21:13
@graphite-app graphite-app Bot changed the base branch from graphite-base/195 to main April 2, 2026 21:13
Address review: filter was too broad and could suppress real asset
failures. Now only suppresses 404s matching fonts.googleapis,
fonts.gstatic, or .woff2 file extensions. Missing images, scripts,
and videos will still surface as [Browser:ERROR] in render output.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vanceingalls vanceingalls force-pushed the fix/render-suppress-font-404-noise branch from e76e312 to dc47aa7 Compare April 2, 2026 21:13
@vanceingalls vanceingalls merged commit 38aadc2 into main Apr 2, 2026
21 checks passed
miguel-heygen added a commit that referenced this pull request Apr 3, 2026
…#195)

* fix(engine): suppress font-loading 404 noise in render console output

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(engine): downgrade resource 404s to buffer-only instead of suppressing

Address review feedback: instead of silently dropping "Failed to load
resource" errors (which could hide real asset failures), keep them in
browserConsoleBuffer for diagnostics but don't print to stdout. Real
asset 404s are still caught by the file server's own logging.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(engine): narrow 404 filter to font CDN domains and woff2 files only

Address review: filter was too broad and could suppress real asset
failures. Now only suppresses 404s matching fonts.googleapis,
fonts.gstatic, or .woff2 file extensions. Missing images, scripts,
and videos will still surface as [Browser:ERROR] in render output.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@miguel-heygen miguel-heygen deleted the fix/render-suppress-font-404-noise branch April 6, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants