Skip to content

🎥 Make videos programmatically with React

fix circular reference

Jonny Burgerb5195aa0f66b
diff --git a/packages/renderer/src/render-still.ts b/packages/renderer/src/render-still.ts
index 75c7e965f9..1cdcf964a2 100644
--- a/packages/renderer/src/render-still.ts
+++ b/packages/renderer/src/render-still.ts
@@ -145,6 +145,17 @@ const innerRenderStill = async ({
deviceScaleFactor: scale ?? 1,
});
+ const errorCallback = (err: Error) => {
+ onError(err);
+ cleanup();
+ };
+
+ const cleanUpJSException = handleJavascriptException({
+ page,
+ onError: errorCallback,
+ frame: null,
+ });
+
const cleanup = async () => {
cleanUpJSException();
@@ -161,16 +172,6 @@ const innerRenderStill = async ({
cleanup();
});
- const errorCallback = (err: Error) => {
- onError(err);
- cleanup();
- };
-
- const cleanUpJSException = handleJavascriptException({
- page,
- onError: errorCallback,
- frame: null,
- });
await setPropsAndEnv({
inputProps,
envVariables,