Repository navigation
@remotion/studio: Fix staticFile() assets after server restarts - #11962
Merged
Merged
Conversation
Contributor
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Deterministic static namespace —
packages/studio-server/src/start-studio.ts:131now derivesstaticHashfrom a truncated SHA-256 of[remotionRoot, publicDir]instead of a per-startup random value.staticFile()URLs therefore survive a Studio restart, and because both inputs are absolute paths they stay scoped to the same project/public folder (a moved project or changedpublicDirgets a new namespace and the old URL 404s via the existingstaticHashPrefixguard). - Independent output namespace —
outputHashremains random per startup (output routes serve relative to the project root, so an immutable predictable prefix would be undesirable) and is threaded explicitly throughhandleRoutes→handleFallback→BundlerInternals.indexHtml(packages/studio-server/src/routes.ts,packages/studio-shared/src/studio-html.ts), replacing the oldstaticBase.replace('static', 'outputs')inference. - Explicit client base —
window.remotion_outputsBaseis emitted by the HTML bootstrap, declared inpackages/core/src/index.ts:74, and read directly inpackages/studio/src/helpers/get-asset-metadata.ts:8(?? ''). Thenullbranches for the bundled and Browser Studio paths carry no output server, and Browser Studio already produced an empty base because itsstaticHashis'', so those call sites are behavior-preserving.
Cross-checks performed: all four indexHtml/studioHtml call sites pass the new required field; indexHtml is only surfaced through BundlerInternals, so requiring outputHash is not a public-API break; and no code still derives the outputs base from remotion_staticBase.
deepseek-v4.1-flash | 𝕏
Member
Author
|
Verified the caching concern for the common workflow: replace a public asset on disk under the same filename, then refresh the Studio tab.
No stale-cache regression was reproduced for replace-file → refresh in these checks. This verification does not cover reconnecting an already-open tab without refreshing, or all browser engines. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Fix Studio assets failing to load after the server is stopped and started again.
nullbecause they do not have an output server.staticFile()fallbacks consistent. Exclude query versions from serialized file tokens and handle versioned, encoded URLs in both watch APIs, deletion, and timeline asset links.Closes #11895
Verification
bun run buildbun run stylecheckNo new tests or dependencies were added; the existing HTML test fixture was updated for the new bootstrap input.