Skip to content

πŸŽ₯ Make videos programmatically with React

chore: handle Minified React error #306

kaf-lamed-beyt2a1c31ed2962
diff --git a/packages/cli/src/handle-common-errors.ts b/packages/cli/src/handle-common-errors.ts
index ae0d9d8c5d..3358203eeb 100644
--- a/packages/cli/src/handle-common-errors.ts
+++ b/packages/cli/src/handle-common-errors.ts
@@ -49,4 +49,13 @@ export const handleCommonError = async (err: Error) => {
)
);
}
+
+ if (err.message.includes("Minified React error #306")) {
+ const componentName = err.message.match(/<\w+>/)?.[0] || ""
+ const errorMsg = `Error: Failed to render ${componentName}. Please check that it is imported correctly.`
+ Log.error(errorMsg)
+ Log.info(
+ 'πŸ’‘ You can try taking a look at the path of the component that you are referencing. It could be the cause of this error.'
+ )
+ }
};