Skip to content

🎥 Make videos programmatically with React

fix errors

Jonny Burgere7e11f7dd776
diff --git a/packages/example/testlambda.sh b/packages/example/testlambda.sh
index 32db87d0e4..f09c851c48 100644
--- a/packages/example/testlambda.sh
+++ b/packages/example/testlambda.sh
@@ -5,6 +5,6 @@ cd ..
cd example
npx remotion lambda policies validate
npx remotion lambda functions rmall -f
-npx remotion lambda functions deploy --memory=3000
+npx remotion lambda functions deploy --memory=3000 --architecture=x86_64
npx remotion lambda sites create src/index.tsx --site-name=testbed
-npx remotion lambda render testbed --frames=10-20 react-svg --out-name=ggg.mp4 ggg.mp4 --log=verbose
+npx remotion lambda render testbed --frames=10-20 react-svg --out-name=ggg.mp4 ggg.mp4 --log=verbose
diff --git a/packages/lambda/remotionlambda.zip b/packages/lambda/remotionlambda.zip
index 4a3a2ba8f4..0d3658fc2c 100644
Binary files a/packages/lambda/remotionlambda.zip and b/packages/lambda/remotionlambda.zip differ
diff --git a/packages/lambda/src/api/create-function.ts b/packages/lambda/src/api/create-function.ts
index ac1c315d05..4aad5bb875 100644
--- a/packages/lambda/src/api/create-function.ts
+++ b/packages/lambda/src/api/create-function.ts
@@ -75,7 +75,7 @@ export const createFunction = async ({
Description: 'Renders a Remotion video.',
MemorySize: memorySizeInMb,
Timeout: timeoutInSeconds,
- Layers: hostedLayers[region].map(
+ Layers: hostedLayers[architecture][region].map(
({layerArn, version}) => `${layerArn}:${version}`
),
Architectures: [architecture],
diff --git a/packages/lambda/src/shared/validate-architecture.ts b/packages/lambda/src/shared/validate-architecture.ts
index bdddf55d97..7036a62264 100644
--- a/packages/lambda/src/shared/validate-architecture.ts
+++ b/packages/lambda/src/shared/validate-architecture.ts
@@ -10,7 +10,7 @@ export const validateArchitecture = (architecture: unknown) => {
);
}
- if (validArchitectures.find((a) => a === architecture)) {
+ if (!validArchitectures.find((a) => a === architecture)) {
throw new TypeError(
`You must pass an "architecture" when deploying a function: either "arm64" or "x86_64"`
);
diff --git a/packages/lambda/src/test/unit/hosted-layers-match.test.ts b/packages/lambda/src/test/unit/hosted-layers-match.test.ts
index c8f78bed87..01ae3fa3a6 100644
--- a/packages/lambda/src/test/unit/hosted-layers-match.test.ts
+++ b/packages/lambda/src/test/unit/hosted-layers-match.test.ts
@@ -1,14 +1,17 @@
+import {LambdaArchitecture} from '../..';
import {
hostedLayers,
REMOTION_HOSTED_LAYER_ARN,
} from '../../shared/hosted-layers';
test('All hosted layers should match ARN', () => {
- Object.values(hostedLayers).forEach((h) => {
- h.forEach(({layerArn}) => {
- expect(layerArn).toMatch(
- new RegExp(REMOTION_HOSTED_LAYER_ARN.replace(/\*/g, '(.*)'))
- );
+ Object.keys(hostedLayers).forEach((arch) => {
+ Object.values(hostedLayers[arch as LambdaArchitecture]).forEach((h) => {
+ h.forEach(({layerArn}) => {
+ expect(layerArn).toMatch(
+ new RegExp(REMOTION_HOSTED_LAYER_ARN.replace(/\*/g, '(.*)'))
+ );
+ });
});
});
});