Skip to content

🎥 Make videos programmatically with React

Docs: Debugging stuck renders

Jonny Burgerc3a6cbc2eb41
diff --git a/packages/docs/docs/timeout.mdx b/packages/docs/docs/timeout.mdx
index 740483ed38..feca1beb07 100644
--- a/packages/docs/docs/timeout.mdx
+++ b/packages/docs/docs/timeout.mdx
@@ -90,6 +90,7 @@ If the call times out, the label will be referenced in the error message:
Uncaught Error: A delayRender() "Fetching data from API..." was called but not cleared after 28000ms. See https://remotion.dev/docs/timeout for help. The delayRender was called
```
+
## See also
- [delayRender()](/docs/delay-render)
diff --git a/packages/docs/docs/troubleshooting/render-stuck.mdx b/packages/docs/docs/troubleshooting/render-stuck.mdx
new file mode 100644
index 0000000000..417bce1d2c
--- /dev/null
+++ b/packages/docs/docs/troubleshooting/render-stuck.mdx
@@ -0,0 +1,47 @@
+---
+image: /generated/articles-docs-troubleshooting-render-stuck.png
+id: stuck-render
+title: Debugging stuck renders
+sidebar_label: Stuck renders
+crumb: "Troubleshooting"
+---
+
+If your render is stuck, proceed as follows:
+
+## Check for long `delayRender()` calls
+
+If the `delayRender()` timeout is too big and does not resolve, a render may get stuck indefinitely without an error message.
+
+This issue may be more confusing on Remotion Lambda, whose runtime also has a timeout.
+If the `delayRender()` timeout is bigger than the Lambda function timeout, the Lambda function will first time out without the `delayRender()` call failing first, leading to no error message.
+
+To debug the issue:
+
+- Set the `delayRender()` timeout value to a smaller value, so that if it does not resolve, an error message is shown.
+- Always sse [`cancelRender()`](/docs/cancel-render) to handle any error that prevents you from calling `continueRender()`.
+
+## Enable verbose logging
+
+[Enable verbose logging](/docs/troubleshooting/debug-failed-render) to see if there are any failures from the browser or other child processes.
+
+## Ensure Chrome Headless Shell is used
+
+Newer Chrome versions may not work with Remotion anymore and cause a render to get stuck, because they have removed the Headless mode.
+Instead, you need to migrate to the [Chrome Headless Shell](/docs/miscellaneous/chrome-headless-shell).
+
+:::note
+This issue does not occur on Remotion Lambda.
+:::
+
+Follow these best practices:
+
+- Do not download Chrome from a Linux package manager.
+- Do not set the `--chrome-executable` option and let Remotion download a compatible version of Chrome Headless Shell for you.
+- Use [`npx remotion browser ensure`](/docs/cli/browser/ensure) to make sure a compatible versions of Chrome Headless Shell is ready before the first render.
+
+## Lambda: Are you reading the `errors` field?
+
+If the [`overallProgress`](/docs/lambda/getrenderprogress#overallprogress) field is stuck on Lambda, ensure that you are:
+
+- Reading the [`errors`](/docs/lambda/getrenderprogress#errors) field to see if there are any errors.
+- not further polling [`getRenderProgress()`](/docs/lambda/getrenderprogress) if the [`fatalErrorEncountered`](/docs/lambda/getrenderprogress#fatalerrorencountered) field is `true`.
diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.js
index b72495f222..dedd01993d 100644
--- a/packages/docs/sidebars.js
+++ b/packages/docs/sidebars.js
@@ -863,6 +863,7 @@ module.exports = {
'troubleshooting/browser-launch',
'troubleshooting/sigkill',
'troubleshooting/could-not-find-executable-to-run',
+ 'troubleshooting/stuck-render',
],
},
{
diff --git a/packages/docs/src/data/articles.ts b/packages/docs/src/data/articles.ts
index 920b42bbbf..e250c75521 100644
--- a/packages/docs/src/data/articles.ts
+++ b/packages/docs/src/data/articles.ts
@@ -3583,6 +3583,13 @@ export const articles = [
compId: 'articles-docs-troubleshooting-nextjs-image',
crumb: 'Common mistakes',
},
+ {
+ id: 'stuck-render',
+ title: 'Debugging stuck renders',
+ relativePath: 'docs/troubleshooting/render-stuck.mdx',
+ compId: 'articles-docs-troubleshooting-render-stuck',
+ crumb: 'Troubleshooting',
+ },
{
id: 'rosetta',
title: 'Apple Silicon under Rosetta',
diff --git a/packages/docs/static/generated/articles-docs-troubleshooting-render-stuck.png b/packages/docs/static/generated/articles-docs-troubleshooting-render-stuck.png
new file mode 100644
index 0000000000..4c3f9af3e9
Binary files /dev/null and b/packages/docs/static/generated/articles-docs-troubleshooting-render-stuck.png differ
diff --git a/packages/renderer/src/render-media.ts b/packages/renderer/src/render-media.ts
index 847f24a776..a0a363e9a4 100644
--- a/packages/renderer/src/render-media.ts
+++ b/packages/renderer/src/render-media.ts
@@ -346,6 +346,15 @@ const internalRenderMediaRaw = ({
'Using concurrency:',
resolvedConcurrency,
);
+ Log.verbose(
+ {
+ indent,
+ logLevel,
+ tag: 'renderMedia()',
+ },
+ 'delayRender() timeout:',
+ timeoutInMilliseconds,
+ );
Log.verbose(
{
indent,