Skip to content

🎥 Make videos programmatically with React

update commands

Jonny Burger7e90ad13649d
diff --git a/packages/template-react-router/README.md b/packages/template-react-router/README.md
index dc552c19cd..ebd60930ff 100644
--- a/packages/template-react-router/README.md
+++ b/packages/template-react-router/README.md
@@ -54,7 +54,7 @@ Follow these steps to set up video rendering:
5. Run the following to deploy your Lambda function and Remotion site:
```
-npm run remotion:deploy
+node deploy.mjs
```
> Rerun this command whenever you have upgraded to a new Remotion version.
@@ -81,10 +81,10 @@ Start the app in production mode (after build is done):
npm run dev
```
-Start the Remotion preview:
+Start the Remotion Studio:
```
-npm run remotion:preview
+npm run remotion:studio
```
Render the example video locally:
@@ -108,7 +108,7 @@ npm run remotion:renderlambda
Deploy/Update the Remotion video on S3 and the Lambda function:
```
-npm run remotion:deploy
+node deploy.mjs
```
## Upgrading Remotion
diff --git a/packages/template-react-router/app/lib/render-video.server.ts b/packages/template-react-router/app/lib/render-video.server.ts
index 35088d22bc..7e2fc0ee4b 100644
--- a/packages/template-react-router/app/lib/render-video.server.ts
+++ b/packages/template-react-router/app/lib/render-video.server.ts
@@ -22,6 +22,23 @@ export const renderVideo = async ({
outName: string;
metadata: Record<string, string> | null;
}): Promise<RenderResponse> => {
+ if (
+ !process.env.AWS_ACCESS_KEY_ID &&
+ !process.env.REMOTION_AWS_ACCESS_KEY_ID
+ ) {
+ throw new TypeError(
+ "Set up Remotion Lambda to render videos. See the README.md for how to do so.",
+ );
+ }
+ if (
+ !process.env.AWS_SECRET_ACCESS_KEY &&
+ !process.env.REMOTION_AWS_SECRET_ACCESS_KEY
+ ) {
+ throw new TypeError(
+ "The environment variable REMOTION_AWS_SECRET_ACCESS_KEY is missing. Add it to your .env file.",
+ );
+ }
+
const region = process.env.REMOTION_AWS_REGION as AwsRegion | undefined;
if (!region) {
throw new Error("REMOTION_AWS_REGION is not set");