Middy: @types/aws-lambda in peer dependencies of @middy/core

Created on 5 Jan 2020  路  3Comments  路  Source: middyjs/middy

Hey there, I am using serverless with serverless-plugin-include-dependencies. I ran into the following build error while deploying:

Error: [serverless-plugin-include-dependencies]: Could not find @types/aws-lambda

I managed to track this down and it is caused by @types/aws-lambda being in peer dependencies of @middy/core. I can't think of a good reason for this to be in here. If this is required at runtime it should be a regular dependency, but realistically typescript should be compiled out by the time I import @middy/core as a module.

If anyone else is running into this, a temporary workaround is to add @types/aws-lambda as a dev dependency on your project.

type-systems

Most helpful comment

Pretty sure it's in there for typescript support. See https://github.com/middyjs/middy/blob/1.0.0-beta/packages/core/index.d.ts. Adding @types/aws-lambda to devDependencies is the solution for now.

All 3 comments

Pretty sure it's in there for typescript support. See https://github.com/middyjs/middy/blob/1.0.0-beta/packages/core/index.d.ts. Adding @types/aws-lambda to devDependencies is the solution for now.

Added @types/aws-lambda to devDepencencies and problem still exists :/

@acdoussan @hansfpc are you still having issues with this? If so, I'll re-open.

FYI We're redoing TS for middy and are looking for help. https://github.com/middyjs/middy/issues/589

Was this page helpful?
0 / 5 - 0 ratings