Skip to content

Fix Remotion DM Sans timeout that broke nightly e2e#118

Merged
nmbrthirteen merged 1 commit into
mainfrom
cursor/fix-nightly-dm-sans-timeout-23e8
Jul 15, 2026
Merged

Fix Remotion DM Sans timeout that broke nightly e2e#118
nmbrthirteen merged 1 commit into
mainfrom
cursor/fix-nightly-dm-sans-timeout-23e8

Conversation

@nmbrthirteen

@nmbrthirteen nmbrthirteen commented Jul 15, 2026

Copy link
Copy Markdown
Owner

What this does

Nightly (run 29393946596) failed on ubuntu/macOS/windows: Remotion's delayRender("Waiting for DM Sans") never cleared under concurrent caption renders. @fontsource was fetching hashed .woff2 files over HTTP from each Chromium tab; those fetches hung. A setTimeout fallback is useless here (timers are throttled in Remotion headless tabs).

This change:

  • Loads latin 400/700 via FontFace from webpack-imported files
  • Inlines .woff/.woff2 as asset/inline data URLs so font load does not hit the network
  • Keeps the existing degrade-to-fallback continueRender path on failure
  • Points remotion/test-render.mjs at 1080×1920 (same as production / e2e), not 2160×3840

How I tested it

  • Reproduced the nightly failure locally: node remotion/test-render.mjs branded timed out waiting for DM Sans
  • After the fix: test-render.mjs branded succeeds; 2160×3840 / 165-frame stress render succeeds
  • python3 scripts/e2e_render.py branded and hormozi both pass
  • npx tsc --noEmit, full npm test, and remotion unit tests pass
  • PR CI: all 14 checks green

Checklist

  • npx tsc --noEmit and npm test pass (plus pytest tests/ if you touched the backend)
  • Docs updated if commands or behavior changed
  • No secrets, personal config, or generated output committed
Open in Web Open in Cursor 

Summary by CodeRabbit

  • Improvements

    • Improved font loading for more reliable rendering.
    • Font assets are now bundled directly to support consistent output across environments.
    • Reduced the rendered video resolution to 1080×1920 for more manageable output files.
  • Tests

    • Added coverage confirming font assets are bundled correctly while image assets retain their existing handling.

Module-level document.fonts.load hung under concurrent Remotion tabs while
@fontsource CSS still fetched hashed woff2 files over HTTP. Inline font
assets and load them via FontFace so delayRender always clears; point the
composition smoke test at 1080x1920 like production.

Co-authored-by: Nika Siradze <siradze@nikusha.me>
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5beef752-3fa3-4551-9569-f0e12a593914

📥 Commits

Reviewing files that changed from the base of the PR and between 07c045d and 9ac90c4.

📒 Files selected for processing (4)
  • remotion/src/Root.tsx
  • remotion/test-render.mjs
  • remotion/webpack-override.mjs
  • remotion/webpack-override.test.mjs

📝 Walkthrough

Walkthrough

The Remotion font pipeline now imports DM Sans WOFF2 assets, inlines font files through webpack, and loads both weights with FontFace before rendering. The test render resolution changes from 2160x3840 to 1080x1920.

Changes

Font asset pipeline

Layer / File(s) Summary
Inline font asset bundling
remotion/webpack-override.mjs, remotion/webpack-override.test.mjs
Font asset rules are converted to asset/inline, while image asset rules remain asset/resource; tests cover both behaviors.
Runtime font loading
remotion/src/Root.tsx
DM Sans WOFF2 files are loaded for weights 400 and 700 through FontFace before continueRender is called.

Render configuration

Layer / File(s) Summary
CaptionedClip render resolution
remotion/test-render.mjs
The composition render dimensions change to 1080x1920.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant RemotionRoot
  participant FontFace
  participant RemotionRenderGate
  RemotionRoot->>FontFace: Load DM Sans weights 400 and 700
  FontFace-->>RemotionRoot: Resolve loaded font faces
  RemotionRoot->>RemotionRenderGate: continueRender
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: fixing the Remotion DM Sans font-loading timeout that caused nightly e2e failures.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/fix-nightly-dm-sans-timeout-23e8

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nmbrthirteen
nmbrthirteen marked this pull request as ready for review July 15, 2026 08:25
@nmbrthirteen
nmbrthirteen merged commit 7dc4819 into main Jul 15, 2026
13 of 14 checks passed
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.

2 participants