Browse Source

fix: deduplicate remotion to fix useVideoConfig in production (#232)

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.
Zorn 3 months ago
parent
commit
b7993ed4ae
1 changed files with 8 additions and 0 deletions
  1. 8 0
      examples/remotion/next.config.js

+ 8 - 0
examples/remotion/next.config.js

@@ -1,6 +1,14 @@
 /** @type {import('next').NextConfig} */
 const nextConfig = {
   transpilePackages: ["@json-render/core", "@json-render/remotion"],
+  turbopack: {
+    resolveAlias: {
+      // Deduplicate remotion — pnpm creates separate copies when peer
+      // dependency versions (React) differ between workspace packages.
+      // Force all imports to resolve from the app's node_modules.
+      remotion: "./node_modules/remotion",
+    },
+  },
 };
 
 export default nextConfig;