serverless-heaven / serverless-webpack

Serverless plugin to bundle your lambdas with Webpack
MIT License
1.72k stars 415 forks source link

Cannot find module 'aws-sdk' #1808

Open kennyhyun opened 4 months ago

kennyhyun commented 4 months ago

This is a Feature Proposal

Description

I think new aws runtime does not support aws-sdk v2 any more for node.js v18 and higher

https://docs.aws.amazon.com/lambda/latest/dg/nodejs-package.html#nodejs-package-dependencies

I had the error message from the runtime below

INIT_START Runtime Version: nodejs:18.v29   Runtime Version ARN: arn:aws:lambda:ap-southeast-2::runtime:5c2d7f0b914a9dbb8b6a6e3117c7950fa2b7434331c349799226fadd052f19a9

It would be nice if the readme includes about the aws sdk versions and how to set the forceExclude option according to the lambda and sdk versions.

Similar or dependent issue(s):

Additional Data

Just removing forceExclude was also problematic, because I had some weird message like

Resource handler returned message: "Unzipped size must be smaller than 130091036 bytes (Service: Lambda, Status Code: 400, Request ID: 2b747230-9910-4363-b452-ae616b90c0d6)" (RequestToken: bc369ba5-0db0-00e9-fbd3-d3397fbbec6e, HandlerErrorCode: InvalidRequest)

although the limit is supposed to be 250MB unzipped.

kennyhyun commented 4 months ago

I misread the doc, so sdk v3 is supposed to be included. let me review this issue


done, now it's just for advice and readme