Hi all, I’ve just started working with Serverless Functions on Netlify and I’m having trouble deploying my API.
I’ve built a Graphql API using Prisma (full repo here, please ignore the readme, just personal notes on how it works). The API works well locally, but I have not been able to deploy it.
Initially I was getting this error when deploying:
Error: In file "/home/leonardo/mci-backend/dist/server.js": Cannot find module 'aws-lambda'
Require stack:
- /home/leonardo/mci-backend/node_modules/@netlify/zip-it-and-ship-it/src/resolve.js
- /home/leonardo/mci-backend/node_modules/@netlify/zip-it-and-ship-it/src/dependencies.js
- /home/leonardo/mci-backend/node_modules/@netlify/zip-it-and-ship-it/src/main.js
- /home/leonardo/mci-backend/node_modules/@netlify/zip-it-and-ship-it/src/bin.js
But adding aws-lambda
to my package.json
fixed it, I’m not sure if that’s the way I was supposed to fix it, but since it’s working I won’t complain.
I’m now facing another issue when building:
11:02:08 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
11:02:08 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
This is happening on two of my files, schema.zip
and server.zip
which are respectively 62,223kb
and 66,509kb
.
Googling makes me realise these two are simply too big to upload, but I honstly have no clue how I could possibly make them any smaller as they’re already really barebones.
Any idea how I can get out of this?
Here’s my full build log: https://pastebin.com/5XZQfu0b