🎥 Make videos programmatically with React
update vercel functions guidance
Jonny Burger4b0d6a260320
diff --git a/packages/docs/docs/miscellaneous/vercel-functions.md b/packages/docs/docs/miscellaneous/vercel-functions.mdindex 44bbc24d24..4a4e825613 100644--- a/packages/docs/docs/miscellaneous/vercel-functions.md+++ b/packages/docs/docs/miscellaneous/vercel-functions.md@@ -11,7 +11,16 @@ However, you can trigger a Remotion Lambda render through a Vercel Serverless fu## Can I render videos in Next.js?-If you don't deploy to Vercel, it is possible to render videos in API routes using the [server-side rendering](/docs/ssr) primitives.+If you don't deploy to Vercel, it might be possible to render videos in API routes using the [server-side rendering](/docs/ssr) primitives.Check if your provider has enough disk space for Chromium and Remotion and has sufficient CPU and RAM to render videos.-If you plan to deploy to Vercel, we recommend to trigger Remotion Lambda renders from Vercel Serverless functions. See our [Next template](https://github.com/remotion-dev/template-next) or [GitHub Unwrapped project](https://github.com/remotion-dev/github-unwrapped-2022) for an example of how to do so.+⚠️ You need to be aware of the following:++- You cannot use `@remotion/bundler` inside an API route, because it includes Webpack, and the API route itself is being bundled with Webpack. It is not possible to bundle Webpack with Webpack. Instead, use `@remotion/bundler` to create a bundle outside the API route and then use the resulting folder in your API route.+- The `@remotion/renderer` package requires an FFmpeg binary from `node_modules`. Because an API route is being bundled, you might need to override the Webpack configuration to ensure the `compositor` binary is being included in it.+- Error have been reported with the Next.js App Router because the `remotion` package exports client-side components. Those are false positives because no React components are being rendered.++**Recommendation:**++- If you plan to deploy to Vercel, we recommend to trigger Remotion Lambda renders from Vercel Serverless functions. See our [Next template](https://github.com/remotion-dev/template-next) or [GitHub Unwrapped project](https://github.com/remotion-dev/github-unwrapped-2022) for an example of how to do so.+- If you plan to deploy to a long-running server, we recommend rendering in a pure Node.js environment outside of Next.js API routes to avoid the complications of bundling server-side code.