Skip to content

Cannot find module 'aws-sdk' #1808

@kennyhyun

Description

@kennyhyun

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

  • Serverless-Webpack Version: 5.13.0
  • Webpack version: 4.44.0
  • Serverless Framework Version: 1.77.1
  • Operating System: Linux

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions