🎥 Make videos programmatically with React
improve lambda version mismatch error message
Jonny Burger36d0eec4f455
diff --git a/packages/lambda/src/functions/progress.ts b/packages/lambda/src/functions/progress.tsindex 9c901d18e6..1e4f13273e 100644--- a/packages/lambda/src/functions/progress.ts+++ b/packages/lambda/src/functions/progress.ts@@ -20,12 +20,12 @@ export const progressHandler = (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.`+ `Version mismatch: When calling renderStillOnLambda(), you called the function ${process.env.AWS_LAMBDA_FUNCTION_NAME} which has the version ${VERSION} but the @remotion/lambda package is an older version. Deploy a new function and use it to call renderStillOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`);}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.`+ `Version mismatch: When calling renderStillOnLambda(), you passed ${process.env.AWS_LAMBDA_FUNCTION_NAME} as the function, which has the version ${VERSION}, but the @remotion/lambda package you used to invoke the function has version ${lambdaParams.version}. Deploy a new function and use it to call renderStillOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`);}diff --git a/packages/lambda/src/functions/start.ts b/packages/lambda/src/functions/start.tsindex 8633123730..fb3d6296ee 100644--- a/packages/lambda/src/functions/start.ts+++ b/packages/lambda/src/functions/start.ts@@ -20,12 +20,12 @@ export const startHandler = async (params: LambdaPayload, options: Options) => {if (params.version !== VERSION) {if (!params.version) {throw new Error(- `Version mismatch: When calling renderMediaOnLambda(), the deployed Lambda function had version ${VERSION} but the @remotion/lambda package is an older version. Align the versions.`+ `Version mismatch: When calling renderMediaOnLambda(), you called the function ${process.env.AWS_LAMBDA_FUNCTION_NAME} which has the version ${VERSION} but the @remotion/lambda package is an older version. Deploy a new function and use it to call renderMediaOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`);}throw new Error(- `Version mismatch: When calling renderMediaOnLambda(), get deployed Lambda function had version ${VERSION} and the @remotion/lambda package has version ${params.version}. Align the versions.`+ `Version mismatch: When calling renderMediaOnLambda(), you passed ${process.env.AWS_LAMBDA_FUNCTION_NAME} as the function, which has the version ${VERSION}, but the @remotion/lambda package you used to invoke the function has version ${params.version}. Deploy a new function and use it to call renderMediaOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`);}diff --git a/packages/lambda/src/functions/still.ts b/packages/lambda/src/functions/still.tsindex b101397cd5..3c84e25c9a 100644--- a/packages/lambda/src/functions/still.ts+++ b/packages/lambda/src/functions/still.ts@@ -54,15 +54,17 @@ const innerStillHandler = async (}if (lambdaParams.version !== VERSION) {- if (!lambdaParams.version) {+ if (lambdaParams.version !== VERSION) {+ if (!lambdaParams.version) {+ throw new Error(+ `Version mismatch: When calling renderMediaOnLambda(), you called the function ${process.env.AWS_LAMBDA_FUNCTION_NAME} which has the version ${VERSION} but the @remotion/lambda package is an older version. Deploy a new function and use it to call renderMediaOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`+ );+ }+throw new Error(- `Version mismatch: When calling renderStillOnLambda(), the deployed Lambda function had version ${VERSION} but the @remotion/lambda package is an older version. Align the versions.`+ `Version mismatch: When calling renderMediaOnLambda(), you passed ${process.env.AWS_LAMBDA_FUNCTION_NAME} as the function, which has the version ${VERSION}, but the @remotion/lambda package you used to invoke the function has version ${lambdaParams.version}. Deploy a new function and use it to call renderMediaOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`);}-- throw new Error(- `Version mismatch: When calling renderStillOnLambda(), get deployed Lambda function had version ${VERSION} and the @remotion/lambda package has version ${lambdaParams.version}. Align the versions.`- );}validateDownloadBehavior(lambdaParams.downloadBehavior);