Unzipped size must be smaller than 262144000 bytes

Hi,

I came from Single, small function to big to deploy?

I have a AWS Lambda project with Express which starts to give me space errors:

An error occurred: NestLambdaFunction - Unzipped size must be smaller than 262144000 bytes (Service: AWSLambdaInternal; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 9f0d80b5-5f0d-44f8-873c-f73c873e47cf; Proxy: null).

This is my serverless.yaml:

service: gestios-lambda #Name of your App

plugins:

  - serverless-domain-manager

custom:

  stage: ${opt:stage, self:provider.stage}

  domains:

    pro: fn.gestios.es

    dev: fn.gestios.dev

  customDomain:

    domainName: ${self:custom.domains.${self:custom.stage}}

    stage: ${self:custom.stage}

    certificateArn: arn:aws:acm:us-east-1:306915287382:certificate/ebb38650-1c0a-436e-923a-ee195cd328d6

    endpointType: 'edge'

    createRoute53Record: false

    apiType: rest

provider:

  name: aws

  runtime: nodejs10.x

  memorySize: 512

  timeout: 15

  stage: production

  region: eu-west-1

functions:

  maras:

    handler: projects/maras/lambda.handler

    package:

        individually: true

        exclude:

            - node_modules/**

    events:

      - http: ANY /maras/{proxy+}

      - http: ANY /maras

  nest:

    handler: projects/nest/lambda.handler

    package:

        individually: true

        exclude:

            - node_modules/**

    events:

      - http: ANY /nest/{proxy+}

      - http: ANY /nest

This is my .serverless folder files and sizes:

The nest module folder (including node_modules)

I try to exclude dev modules, node_modules and package individually but problem persist.

anyone can help me? Its very frustrating and confuse :joy:

1 Like