Skip to content

πŸŽ₯ Make videos programmatically with React

improve multiple versions warning

Jonny Burger71031b2df643
diff --git a/packages/core/src/multiple-versions-warning.ts b/packages/core/src/multiple-versions-warning.ts
index e94192766f..b6c3b5bd41 100644
--- a/packages/core/src/multiple-versions-warning.ts
+++ b/packages/core/src/multiple-versions-warning.ts
@@ -10,7 +10,9 @@ export const checkMultipleRemotionVersions = () => {
(globalThis as unknown as Window).remotion_imported ||
(typeof window !== 'undefined' && window.remotion_imported);
- if (alreadyImported) {
+ // Next.JS will reload the package and cause a server-side warning.
+ // It's okay if the version is the same
+ if (alreadyImported && alreadyImported !== VERSION) {
throw new TypeError(
`🚨 Multiple versions of Remotion detected: ${[
VERSION,
@@ -25,7 +27,7 @@ export const checkMultipleRemotionVersions = () => {
);
}
- (globalThis as unknown as Window).remotion_imported = true;
+ (globalThis as unknown as Window).remotion_imported = VERSION;
if (typeof window !== 'undefined') {
window.remotion_imported = VERSION;
}