Skip to content

🎥 Make videos programmatically with React

better error message

Jonny Burgerc7c0728078b1
diff --git a/packages/lambda/src/functions/launch.ts b/packages/lambda/src/functions/launch.ts
index 9853561340..f1206d2f3c 100644
--- a/packages/lambda/src/functions/launch.ts
+++ b/packages/lambda/src/functions/launch.ts
@@ -473,8 +473,15 @@ const innerLaunchHandler = async (params: LambdaPayload, options: Options) => {
console.log('No webhook specified');
}
+ const firstError = errors[0];
+ if (firstError.chunk !== null) {
+ throw new Error(
+ `Stopping Lambda function because error occurred while rendering chunk ${firstError.chunk}: ${errors[0].stack}`
+ );
+ }
+
throw new Error(
- 'Stopping Lambda function because error occurred: ' + errors[0].stack
+ `Stopping Lambda function because error occurred: ${errors[0].stack}`
);
};
diff --git a/packages/renderer/src/seek-to-frame.ts b/packages/renderer/src/seek-to-frame.ts
index e135509d64..9f56127b2f 100644
--- a/packages/renderer/src/seek-to-frame.ts
+++ b/packages/renderer/src/seek-to-frame.ts
@@ -25,20 +25,15 @@ export const waitForReady = ({
reject(new Error('Target closed'));
});
}),
- page
- .mainFrame()
- ._mainWorld.waitForFunction({
- browser: page.browser,
- timeout: timeoutInMilliseconds,
- pageFunction: 'window.remotion_renderReady === true',
- title:
- frame === null
- ? 'the page to render the React component'
- : `the page to render the React component at frame ${frame}`,
- })
- .catch((err) => {
- throw err;
- }),
+ page.mainFrame()._mainWorld.waitForFunction({
+ browser: page.browser,
+ timeout: timeoutInMilliseconds,
+ pageFunction: 'window.remotion_renderReady === true',
+ title:
+ frame === null
+ ? 'the page to render the React component'
+ : `the page to render the React component at frame ${frame}`,
+ }),
page
.mainFrame()
._mainWorld.waitForFunction({