fix: deduplicate remotion to fix useVideoConfig in production#232
Merged
ctate merged 1 commit intovercel-labs:mainfrom Mar 20, 2026
Merged
fix: deduplicate remotion to fix useVideoConfig in production#232ctate merged 1 commit intovercel-labs:mainfrom
ctate merged 1 commit intovercel-labs:mainfrom
Conversation
pnpm creates separate copies of remotion@4.0.418 when peer dependency versions differ between workspace packages (e.g. react@19.2.3 vs react@19.2.4). This causes two React contexts, so useVideoConfig() in @json-render/remotion cannot see the Player's context. Add turbopack.resolveAlias to force all remotion imports to resolve from the app's node_modules, ensuring a single instance.
Contributor
|
@vzt7 is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
Collaborator
|
Thank you so much for the fix @vzt7 |
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.
Problem
The remotion example throws
useVideoConfig()error in production:Error stack trace
Root Cause
pnpm creates two separate copies of
remotion@4.0.418because peer dependency versions differ between workspace packages:remotionpeer contextexample-remotionreact@19.2.3,react-dom@19.2.3@json-render/remotionreact@19.2.4,react-dom@19.2.4Two
remotioninstances → twoReact.createContext()calls →<Player />sets context in one copy,useVideoConfig()reads from the other → "No video config found".Fix
Add
turbopack.resolveAliasinnext.config.jsto force allremotionimports to resolve from the app'snode_modules, ensuring a single instance.Test plan
pnpm --filter example-remotion buildsucceeds with Turbopack