Hello. I’m trying to build a rest api with python ...
# help
r
Hello. I’m trying to build a rest api with python (https://github.com/serverless-stack/serverless-stack/tree/master/examples/rest-api-python).
npm run start
works fine but
npm run deploy
gives an error
Resource handler returned message: "Unzipped size must be smaller than 262144000 bytes"
. I’m guessing this is because it is uploading _*node_modules*_ as I’m not using any python imports_*.*_ How can I prevent _*node_modules*_ from being deployed?
r
Are you using any layers? I literally had the same issue yesterday but using TypeScript. If I referenced a layer and deployed I got that message. I removed the layer, deployed, then re-added it and deployed again and the message went away. https://github.com/agutoli/serverless-layers/issues/51
r
I’m not using any layers
t
@Rayaan Hussain for python we upload the entirety of the
srcPath
which is set to
src
in that example
f
@Rayaan Hussain Yeah just to expand on that,
node_modules
should be at ur root, and SST is only zipping up
src
as the Lamba package.
If u run
sst build
, and then go into
.build/cdk.out
, you should be able to see the Lambda packages created. You can check what is taking up the most space.