Something weird is starting to happen using Serverless where we are using v3 (non-paid version).
Two of our developers have started getting an issue with Unzipped size must be smaller than 262144000 bytes
message when they try to deploy to their AWS sandbox accounts and looking at the ZIP size it's 93MB for every function in the package!
This 93MB ZIP is then of course more than 262144000 bytes unpacked.
serverless.yml has: frameworkVersion: "3" package: individually: true patterns:
However, the two affected developers are running native Ubuntu and the other Windows 11 with WSL2 and Ubuntu.
All hosts are running Node v20 and npm v9
Looking at the developers using Mac, they have a ZIP size of 28MB, but looking at GitHub Actions doing a deploy using Ubuntu the ZIP size at deploy is only 15MB.
So, the size difference between Mac and Ubuntu is really weird, but it would seem that Serverless is not capable of excluding dependencies as it should...
We've doublechecked the ZIP's and it node_modules
that's massive in the ZIP's... E.g. containing serverless
, aws-sdk
, which is a dependency of serverless
even though we, in code, are only using AES SDK v3, s it's clearly dependencies being added...
Any clues on why this happens?