Anyone run into this error before: `Error: This la...
# help
k
Anyone run into this error before:
Error: This lambda function uses a runtime that is incompatible with this layer (nodejs14.x is not in [nodejs, nodejs4.3, nodejs6.10, nodejs8.10, nodejs10.x, nodejs12.x, nodejs14.x, python2.7, python3.6, python3.7, python3.8, python3.9, java8, java8.al2, java11, dotnetcore1.0, dotnetcore2.0, dotnetcore2.1, dotnetcore3.1, go1.x, ruby2.5, ruby2.7, provided, provided.al2, FROM_IMAGE])
This just started happening - seemingly randomly - after having worked fine for the last day or so.. The specified runtime that it is complaining about is in fact in the list of compatible runtimes..
g
What is the code where you implement the runtime? My assumption would be mixmatched versions of cdk
or rather what is your package.json specially sst and cdk
k
Copy code
"devDependencies": {
    "@aws-cdk/assert": "1.114.0",
    "@types/aws-lambda": "^8.10.70"
  },
  "dependencies": {
    "@aws-cdk/aws-iam": "^1.124.0",
    "@aws-cdk/aws-ses": "^1.122.0",
    "@aws-cdk/core": "1.114.0",
    "@serverless-stack/cli": "0.40.5",
    "@serverless-stack/resources": "0.40.5",
  }
g
You do have some differing cdk version dependencies, however, it seems the lambda runtime should be fine so not entirely sure why that's happening. For sst v0.40.5 all cdk resources you install should be 1.114.0 though.
k
Ok, I'll try updating those
thanks - that must have been the problem - aligning the cdk versions seems to have fixed it
g
Ok yeah one of the mismatched version must have had a dependency on cdk/aws-lambda and it was using the wrong version from that.
b
When adding cdk packages use
sst add-cdk
it’ll make sure the installed package(s) matches what sst is using.