🎥 Make videos programmatically with React
also version check getRenderProgress()
Jonny Burger2de23f1a991f
diff --git a/packages/lambda/src/functions/progress.ts b/packages/lambda/src/functions/progress.tsindex 1fcca32275..2fa1e0e5bc 100644--- a/packages/lambda/src/functions/progress.ts+++ b/packages/lambda/src/functions/progress.ts@@ -1,9 +1,6 @@-import type {- LambdaPayload,- RenderProgress} from '../shared/constants';-import {- LambdaRoutines-} from '../shared/constants';+import {VERSION} from 'remotion/version';+import type {LambdaPayload, RenderProgress} from '../shared/constants';+import {LambdaRoutines} from '../shared/constants';import {getCurrentRegionInFunction} from './helpers/get-current-region';import {getProgress} from './helpers/get-progress';@@ -20,6 +17,18 @@ export const progressHandler = (throw new TypeError('Expected status type');}+ if (lambdaParams.version !== VERSION) {+ if (!lambdaParams.version) {+ throw new Error(+ `Version mismatch: When calling getRenderProgress(), the deployed Lambda function had version ${VERSION} but the @remotion/lambda package is an older version. Align the versions.`+ );+ }++ throw new Error(+ `Version mismatch: When calling getRenderProgress(), get deployed Lambda function had version ${VERSION} and the @remotion/lambda package has version ${lambdaParams.version}. Align the versions.`+ );+ }+return getProgress({bucketName: lambdaParams.bucketName,renderId: lambdaParams.renderId,diff --git a/packages/lambda/src/functions/start.ts b/packages/lambda/src/functions/start.tsindex d6bfb060a0..1c17826a3e 100644--- a/packages/lambda/src/functions/start.ts+++ b/packages/lambda/src/functions/start.ts@@ -15,12 +15,12 @@ export const startHandler = async (params: LambdaPayload) => {if (params.version !== VERSION) {if (!params.version) {throw new Error(- `Version mismatch: A Lambda function with version ${VERSION} was called using the @remotion/lambda package with an older version.`+ `Version mismatch: When calling renderMediaOnLambda(), the deployed Lambda function had version ${VERSION} but the @remotion/lambda package is an older version. Align the versions.`);}throw new Error(- `Version mismatch: A Lambda function with version ${VERSION} was called using the @remotion/lambda package with version ${params.version}`+ `Version mismatch: When calling renderMediaOnLambda(), get deployed Lambda function had version ${VERSION} and the @remotion/lambda package has version ${params.version}. Align the versions.`);}diff --git a/packages/lambda/src/functions/still.ts b/packages/lambda/src/functions/still.tsindex 3607dfb530..9e258dde02 100644--- a/packages/lambda/src/functions/still.ts+++ b/packages/lambda/src/functions/still.ts@@ -51,12 +51,12 @@ const innerStillHandler = async (if (lambdaParams.version !== VERSION) {if (!lambdaParams.version) {throw new Error(- `Version mismatch: A Lambda function with version ${VERSION} was called using the @remotion/lambda package with an older version.`+ `Version mismatch: When calling renderStillOnLambda(), the deployed Lambda function had version ${VERSION} but the @remotion/lambda package is an older version. Align the versions.`);}throw new Error(- `Version mismatch: A Lambda function with version ${VERSION} was called using the @remotion/lambda package with version ${lambdaParams.version}`+ `Version mismatch: When calling renderStillOnLambda(), get deployed Lambda function had version ${VERSION} and the @remotion/lambda package has version ${lambdaParams.version}. Align the versions.`);}diff --git a/packages/lambda/src/shared/constants.ts b/packages/lambda/src/shared/constants.tsindex ad258154b1..8a6ecfa8a1 100644--- a/packages/lambda/src/shared/constants.ts+++ b/packages/lambda/src/shared/constants.ts@@ -236,6 +236,7 @@ export type LambdaPayloads = {type: LambdaRoutines.status;bucketName: string;renderId: string;+ version: string;};renderer: {concurrencyPerLambda: number;