Prisma 2.20.x increased archive size exceeds the maximum size limit of 50mb for lambda functions on Vercel
See original GitHub issueBug description
After upgrading prisma packages from 2.19.0 to 2.20.x I get the following message when deploying my Next.js project on Vercel:
Failed to process build result for "api/v1/graphql". Data: {"type":"Lambda","zipBuffer":{"type":"Buffer","data":[80,75,3,4,20,0,0,8,8,0,193,174,166,82,203,126,12,106,139,71,0,0,126,92,10,0,36,0,0,0,110,111,100,101,95,109,111,100,117,108,101,115,47,46,112,114,105,115,109,97,47,99,108,105,101,110,116,47,105,110,100,.
Error: The Serverless Function "api/core/v1/graphql" is 78.49mb which exceeds the maximum size limit of 50mb. Learn More: https://vercel.link/serverless-function-size
with
23:54:03.286 | Serverless Function's page: api/v1/graphql.js
-- | --
23:54:03.291 | Large Dependencies Uncompressed size Compressed size
23:54:03.291 | node_modules/@prisma/engines 113 MB 39.6 MB
23:54:03.291 | node_modules/.prisma/client 46.2 MB 16.1 MB
23:54:03.292 | node_modules/prisma/build 5.27 MB 1.09 MB
23:54:03.292 | node_modules/@prisma/client 3.93 MB 822 kB
23:54:03.292 | node_modules/prettier/parser-typescript.js 3.07 MB 788 kB
23:54:03.292 | node_modules/highlight.js/lib 1.41 MB 458 kB
23:54:03.292 | node_modules/prettier/index.js 1.66 MB 382 kB
23:54:03.292 | node_modules/prettier/parser-flow.js 3.09 MB 305 kB
23:54:03.292 | node_modules/typeorm/driver 1.6 MB 214 kB
23:54:03.292 | node_modules/busboy/deps 618 kB 196 kB
23:54:03.292 | node_modules/micro/node_modules 360 kB 190 kB
23:54:03.292 | node_modules/encoding/node_modules 328 kB 179 kB
23:54:03.292 | node_modules/lodash/lodash.js 544 kB 96.4 kB
23:54:03.292 | All dependencies 190 MB 62.6 MB
When I revert back to 2.19.0 deploys succeed. Unfortunately, I don’t get a report on the archive sizes in the succeeding case.
How to reproduce
Don’t have a reprducable example that I can share at the moment, but I hope the attached information is sufficient.
Expected behavior
Prisma bundle size should not increase to the point where one hits the AWS limits for serverless functions.
Prisma information
Here are all prisma related packages in my package.json
for the failing case (when I change back to 2.19.0 in the two prisma instances below, everything works as expected).
"dependencies": {
"@nexus/schema": "^0.20.1",
"@prisma/client": "^2.22.1",
"@urql/exchange-graphcache": "^4.0.0",
"apollo-server-micro": "^2.24.0",
"graphql": "^15.5.0",
"graphql-tag": "^2.12.4",
"nexus": "^1.0.0",
"nexus-plugin-prisma": "^0.34.1",
"urql": "^2.0.2",
},
"devDependencies": {
"@graphql-codegen/cli": "^1.21.4",
"@graphql-codegen/typescript": "^1.22.0",
"@graphql-codegen/typescript-operations": "^1.17.16",
"@graphql-codegen/typescript-urql": "^2.0.6",
"next-prisma-plugin": "^0.1.1",
"prisma": "^2.22.1",
}
Environment & setup
- OS: Fedora
- Database: PostgreSQL
- Node.js version: 14.x
- Prisma version: 2.22.1 (failing for 2.20.x)
Issue Analytics
- State:
- Created 2 years ago
- Comments:19 (12 by maintainers)
Top Results From Across the Web
Limits – Vercel Docs
The maximum size for a Serverless Function is 50 MB and the maximum unzipped size is 250 MB including layers which are automatically...
Read more >Serverless Function exceeds the maximum size limit of 50mb
I'm trying to deploy a Flask REST API on Vercel, and in my latest commit, I'm running into this error during deployment:
Read more >serverless function exceeds maximum size limit of 50mb
I realize this is probably a puppeteer problem but maybe you can help? When i deploy my app with the getScreenshot call to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah, the Vercel function page in the deployment (where you can use the dropdown to select the function) actually shows you the archive size all the time:
No details though unfortunately.
Final update in the other thread, as we could figure out the reason why all this was happening: https://github.com/prisma/prisma/issues/6932#issuecomment-843539427