Skip to content

🎥 Make videos programmatically with React

fix fast refresh triggering Config getter

Jonny Burgerc705ae1acf0b
diff --git a/packages/core/src/config.ts b/packages/core/src/config.ts
index 2a5e4bccd7..48ebe0fcad 100644
--- a/packages/core/src/config.ts
+++ b/packages/core/src/config.ts
@@ -348,6 +348,11 @@ let enabled = false;
export const Config = new Proxy(conf, {
get(target, prop, receiver) {
if (!enabled) {
+ if (typeof document !== 'undefined') {
+ // We are in the browser
+ return {};
+ }
+
throw new Error(
'To use the Remotion config file, you need to have @remotion/cli installed.\n- Make sure that all versions of Remotion are the same.\n- Make sure that @remotion/cli is installed.\n- Make sure Config is imported from "@remotion/cli", not "remotion".'
);