🎥 Make videos programmatically with React
better error message if you pass unserializeable default props
Jonny Burger492cec237f81
diff --git a/packages/renderer/src/puppeteer-evaluate.ts b/packages/renderer/src/puppeteer-evaluate.tsindex 02888f1ef4..107e0d355b 100644--- a/packages/renderer/src/puppeteer-evaluate.ts+++ b/packages/renderer/src/puppeteer-evaluate.ts@@ -133,23 +133,39 @@ export async function puppeteerEvaluateWithCatch<ReturnType>({throw error;}- const {exceptionDetails, result: remoteObject} = await callFunctionOnPromise;- if (exceptionDetails) {- const err = new SymbolicateableError({- stack: exceptionDetails.exception?.description as string,- name: exceptionDetails.exception?.className as string,- message: exceptionDetails.exception?.description?.split(- '\n'- )[0] as string,- frame,- stackFrame: parseStack(- (exceptionDetails.exception?.description as string).split('\n')- ),- });- throw err;- }+ try {+ const {exceptionDetails, result: remoteObject} =+ await callFunctionOnPromise;++ if (exceptionDetails) {+ const err = new SymbolicateableError({+ stack: exceptionDetails.exception?.description as string,+ name: exceptionDetails.exception?.className as string,+ message: exceptionDetails.exception?.description?.split(+ '\n'+ )[0] as string,+ frame,+ stackFrame: parseStack(+ (exceptionDetails.exception?.description as string).split('\n')+ ),+ });+ throw err;+ }- return valueFromRemoteObject(remoteObject);+ return valueFromRemoteObject(remoteObject);+ } catch (error) {+ if (+ (error as {originalMessage: string})?.originalMessage.startsWith(+ "Object couldn't be returned by value"+ )+ ) {+ throw new Error(+ 'Could not serialize the return value of the function. Did you pass non-serializable values to defaultProps?'+ );+ }++ throw error;+ }}/**