Error with Lambda Layers: Class extends value undefined is not a constructor or null #5496
-
I am using Lambda Layers with my Amplify project. I recently upgraded from AWS SDK v2 to v3 and am now experiencing some runtime errors in my Lambda functions that utilize Lambda Layers. I have a Lambda Layer that is used to make AppSync queries and mutations. When that layer is used in a Lambda function, the following error is thrown when the Lambda function tries to load: { Here is my package.json file for the Lambda Layer: { What is strange is that not all of the Lambda functions that use this layer generate this error. I can't identify what is different between the ones that work and the ones that do not. Here is the package.json file for a Lambda function that doesn't work: { And here is the package.json file for a function that does work: { Any suggestions on what might be causing this error would be greatly appreciated. My research has come up with the possibility that it could be circular dependency references or incompatible packages but I cant identify either of those issues in the code. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
It turns out the error was caused by the merge order of the Lambda Layers. Once I changed the order on the Lambda functions that were failing they started working again. Very difficult issue to track down! |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
It turns out the error was caused by the merge order of the Lambda Layers. Once I changed the order on the Lambda functions that were failing they started working again. Very difficult issue to track down!