Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is @aws-sdk/client-lambda now a peer dependency? #333

Closed
agawley opened this issue Dec 14, 2022 · 2 comments
Closed

Is @aws-sdk/client-lambda now a peer dependency? #333

agawley opened this issue Dec 14, 2022 · 2 comments

Comments

@agawley
Copy link

agawley commented Dec 14, 2022

I'm getting an error compiling after moving to 8.2.1

Module not found: Error: Can't resolve '@aws-sdk/client-lambda' in '~/code/serverless/dinghyrace-app/.warmup/apiWarmer'

Looks like as of this change bdb983f it will be required. Just checking as I was surprised by this failure. (I know I should be using the v3 API in my serverless app, but I just haven't got round to migrating...)

@juanjoDiaz
Copy link
Owner

Hi @agawley ,

Sorry for the slow response.

8.2.1 Latest updates the warmer lambda to node18.
Node18 lambdas automatically include the v3 SDK instead of the v2.

It seems that you are doing some sort of bundling.
If so, AWS SDK should be excluded since it's included by default in all lambdas.
Not including the SDK in the lambda helps getting smaller lambas with faster startup time.

If you really want to package it for whatever reason you need to have it as a peer-dependency just as you probably have the v2 SDK at the moment.

@agawley
Copy link
Author

agawley commented Dec 31, 2022

Awesome. Thanks. I've now migrated to v3, so will also migrate to Node 18 and then remove v3 from the bundle. Thanks.

@agawley agawley closed this as completed Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants