@remotion/bundler: Revert rendering window.remotion_logLevel in bundle mode, use fallback instead#6903
Conversation
…undle mode, use fallback instead Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
The revert is correct and well-scoped. Here's the summary:
What changed: PR #6902 rendered window.remotion_logLevel unconditionally in the bundle HTML. This caused the inline script to override the value set later by setPropsAndEnv() via evaluateOnNewDocument, because inline scripts execute before evaluateOnNewDocument.
This PR's fix:
bundler/src/index-html.ts— only renderswindow.remotion_logLevelin dev mode (mode === 'dev'), removing it from bundle modecore/src/index.ts— widens the type toLogLevel | undefinedto match the new reality- All read sites in
studio/src/Studio.tsx,studio/src/renderEntry.tsx,core/src/delay-render.ts, andweb-renderer/add?? 'info'as a safe fallback
Verified: I confirmed all 9 read sites of window.remotion_logLevel across the codebase are covered with the fallback. The web-renderer files already had a triple-chain (options.logLevel ?? window.remotion_logLevel ?? 'info') that correctly handles the undefined case. The set-props-and-env.ts write site in bundle mode remains unchanged — it sets the value before the page loads, which is correct.
In bundle mode, the flow is now: setPropsAndEnv() sets window.remotion_logLevel via evaluateOnNewDocument → page loads → read sites use that value. If somehow neither sets it, 'info' is the fallback. In dev mode, the inline script still sets it as before.
No issues found. This is a clean revert.

Summary
@remotion/bundler: Renderwindow.remotion_logLevelin bundle mode #6902 which renderedwindow.remotion_logLevelin bundle mode, causing it to override the value set bysetPropsAndEnv()viaevaluateOnNewDocumentwindow.remotion_logLeveltypeLogLevel | undefinedand adds?? 'info'fallback at every read sitesetPropsAndEnv()sets it before the page loads, and if neither sets it, it falls back to'info'Test plan
🤖 Generated with Claude Code