Skip to content

🎥 Make videos programmatically with React

better error handling if wrong entry point was specified

Jonny Burger0ca04b10d1e1
diff --git a/packages/bundler/src/renderEntry.tsx b/packages/bundler/src/renderEntry.tsx
index 6097fd3cf0..3749d76e34 100644
--- a/packages/bundler/src/renderEntry.tsx
+++ b/packages/bundler/src/renderEntry.tsx
@@ -123,7 +123,9 @@ let cleanupExplainerContainer = () => {
explainerContainer.innerHTML = '';
};
-const waitForRootHandle = delayRender('Loading root component');
+const waitForRootHandle = delayRender(
+ 'Loading root component - See https://remotion.dev/docs/troubleshooting/loading-root-component if you experience a timeout'
+);
const WaitForRoot: React.FC = () => {
const [Root, setRoot] = useState<React.FC | null>(() => Internals.getRoot());
diff --git a/packages/docs/docs/lambda/troubleshooting/loading-root-component.md b/packages/docs/docs/lambda/troubleshooting/loading-root-component.md
new file mode 100644
index 0000000000..7e21d670a2
--- /dev/null
+++ b/packages/docs/docs/lambda/troubleshooting/loading-root-component.md
@@ -0,0 +1,31 @@
+---
+id: loading-root-component
+title: Root component Timeout
+---
+
+If you get an error message:
+
+```
+A delayRender() "Loading root component" was called but not cleared after 28000ms
+```
+
+You have specified an [entry point](/docs/terminology#entry-point) that does not call [`registerRoot()`](/docs/register-root).
+
+In most of the templates, the entry point is `src/index.ts`.
+
+- Maybe you have specified the list of compositions (`src/Video.tsx` in most templates) instead.
+- Maybe you have specified the filename of a component that you want to render.
+
+Ensure that you are passing the file that calls [`registerRoot()`](/docs/register-root) as the entry point.
+
+In the CLI, the entry point is passed as an argument to the render command:
+
+```
+npx remotion render [entry-point]
+```
+
+In the [`bundle()`](/docs/bundle) and [`deploySite()`](/docs/lambda/deploysite) Node.JS apis, you pass the entry point via the `entryPoint` property.
+
+## See also
+
+- [Timeout](/docs/timeout)
diff --git a/packages/docs/docs/timeout.md b/packages/docs/docs/timeout.md
index a8294fa197..05389dc13d 100644
--- a/packages/docs/docs/timeout.md
+++ b/packages/docs/docs/timeout.md
@@ -91,3 +91,4 @@ Uncaught Error: A delayRender() "Fetching data from API..." was called but not c
- [delayRender()](/docs/delay-render)
- [Data fetching](/docs/data-fetching)
+- [Loading Root Component Timeout](/docs/troubleshooting/loading-root-component)
diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.js
index 690512a616..6310834aa8 100644
--- a/packages/docs/sidebars.js
+++ b/packages/docs/sidebars.js
@@ -360,6 +360,7 @@ module.exports = {
"staticfile-relative-paths",
"staticfile-remote-urls",
"troubleshooting/rosetta",
+ "troubleshooting/loading-root-component",
"troubleshooting/defaultprops-too-big",
],
},