diff --git a/.changeset/fast-wasps-bathe.md b/.changeset/fast-wasps-bathe.md new file mode 100644 index 00000000000..bc92f123b4c --- /dev/null +++ b/.changeset/fast-wasps-bathe.md @@ -0,0 +1,5 @@ +--- +'@aws-amplify/backend-deployer': patch +--- + +add cloud assembly schema version mismatch error to error mapping diff --git a/packages/backend-deployer/src/cdk_error_mapper.test.ts b/packages/backend-deployer/src/cdk_error_mapper.test.ts index da6235b4470..da35094a25d 100644 --- a/packages/backend-deployer/src/cdk_error_mapper.test.ts +++ b/packages/backend-deployer/src/cdk_error_mapper.test.ts @@ -229,6 +229,13 @@ const testErrorMappings = [ expectedDownstreamErrorMessage: `This CDK CLI is not compatible with the CDK library used by your application. Please upgrade the CLI to the latest version. (Cloud assembly schema version mismatch: Maximum schema version supported is 36.0.0, but found 36.1.1)`, }, + { + errorMessage: `Error: Cannot read asset manifest '.amplify/artifacts/cdk.out.assets.json': Cloud assembly schema version mismatch: Maximum schema version supported is 43.x.x, but found 44.0.0`, + expectedTopLevelErrorMessage: + "Installed 'aws-cdk' is not compatible with installed 'aws-cdk-lib'.", + errorName: 'CDKVersionMismatchError', + expectedDownstreamErrorMessage: `Error: Cannot read asset manifest '.amplify/artifacts/cdk.out.assets.json': Cloud assembly schema version mismatch: Maximum schema version supported is 43.x.x, but found 44.0.0`, + }, { errorMessage: `error Command cdk not found. Did you mean cdl?`, expectedTopLevelErrorMessage: 'Unable to detect cdk installation', diff --git a/packages/backend-deployer/src/cdk_error_mapper.ts b/packages/backend-deployer/src/cdk_error_mapper.ts index c15e0c16185..dc701d72cf2 100644 --- a/packages/backend-deployer/src/cdk_error_mapper.ts +++ b/packages/backend-deployer/src/cdk_error_mapper.ts @@ -260,6 +260,17 @@ export class CdkErrorMapper { errorName: 'CDKVersionMismatchError', classification: 'ERROR', }, + // Similar to previous error but there are instances of the error that do not mention upgrading CDK CLI or compatible CDK CLI version + { + errorRegex: + /Cannot read asset manifest .*: Cloud assembly schema version mismatch: Maximum schema version supported is .*, but found .*/, + humanReadableErrorMessage: + "Installed 'aws-cdk' is not compatible with installed 'aws-cdk-lib'.", + resolutionMessage: + "Make sure that version of 'aws-cdk' is greater or equal to version of 'aws-cdk-lib'", + errorName: 'CDKVersionMismatchError', + classification: 'ERROR', + }, { errorRegex: /Command cdk not found/, humanReadableErrorMessage: 'Unable to detect cdk installation',