Skip to content

Write HTML. Render video. Built for agents.

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

Miguel Ángel38aadc2a25fd
diff --git a/packages/engine/src/services/frameCapture.ts b/packages/engine/src/services/frameCapture.ts
index 60a14253b3..6223b7a84a 100644
--- a/packages/engine/src/services/frameCapture.ts
+++ b/packages/engine/src/services/frameCapture.ts
@@ -149,9 +149,21 @@ export async function initializeSession(session: CaptureSession): Promise<void>
page.on("console", (msg: ConsoleMessage) => {
const type = msg.type();
const text = msg.text();
+
+ // Suppress font-loading 404s only. These are expected when deterministic
+ // font injection replaces Google Fonts @import URLs with embedded base64.
+ // Narrowed to font CDN domains and font file extensions to avoid hiding
+ // real asset failures (images, scripts, videos).
+ const isFontLoadError =
+ type === "error" &&
+ text.startsWith("Failed to load resource") &&
+ /fonts\.googleapis|fonts\.gstatic|\.woff2?(\b|$)/i.test(text);
+
const prefix =
type === "error" ? "[Browser:ERROR]" : type === "warn" ? "[Browser:WARN]" : "[Browser]";
- console.log(`${prefix} ${text}`);
+ if (!isFontLoadError) {
+ console.log(`${prefix} ${text}`);
+ }
session.browserConsoleBuffer.push(`${prefix} ${text}`);
if (session.browserConsoleBuffer.length > BROWSER_CONSOLE_BUFFER_SIZE) {