@prisma/engines weights 113 MB and causes maximum size limit error on Vercel
See original GitHub issueBug description
When I try to deploy a Next.js + GraphQL + Prisma application on Vercel I receive an error about exceeding the lambda function limit.
23:15:50.190 Max serverless function size of 50 MB compressed or 250 MB uncompressed hit
23:15:50.190 Serverless Function's page: api/graphql.js
23:15:50.191 Large Dependencies Uncompressed size Compressed size
23:15:50.191 node_modules/@prisma/engines 113 MB 39.6 MB
23:15:50.191 node_modules/.prisma/client 45.9 MB 16.1 MB
23:15:50.191 node_modules/prisma/build 5.27 MB 1.09 MB
Full log here: https://gist.github.com/talentlessguy/74f58664cd5af05407037be15b3b25a1
How to reproduce
- Create a new Next.js project with these files: https://gist.github.com/talentlessguy/9cac915be4fa6a1ea911c7f0ead5fa2b
Expected behavior
I expected a Next.js app to build and launch as it usually does (it did run fine 1-2 weeks ago)
Prisma information
Schema: https://gist.github.com/talentlessguy/9cac915be4fa6a1ea911c7f0ead5fa2b#file-graphql_schema-ts
Environment & setup
- OS: Vercel Linux runtime
- Database: PostgreSQL
- Node.js version: 14.16
- Prisma version: 2.22.0
prisma : 2.22.0
@prisma/client : 2.22.0
Current platform : debian-openssl-1.1.x
Query Engine : query-engine 60cc71d884972ab4e897f0277c4b84383dddaf6c (at node_modules/.pnpm/@prisma+engines@2.22.0-21.60cc71d884972ab4e897f0277c4b84383dddaf6c/node_modules/@prisma/engines/query-engine-debian-openssl-1.1.x)
Migration Engine : migration-engine-cli 60cc71d884972ab4e897f0277c4b84383dddaf6c (at node_modules/.pnpm/@prisma+engines@2.22.0-21.60cc71d884972ab4e897f0277c4b84383dddaf6c/node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x)
Introspection Engine : introspection-core 60cc71d884972ab4e897f0277c4b84383dddaf6c (at node_modules/.pnpm/@prisma+engines@2.22.0-21.60cc71d884972ab4e897f0277c4b84383dddaf6c/node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x)
Format Binary : prisma-fmt 60cc71d884972ab4e897f0277c4b84383dddaf6c (at node_modules/.pnpm/@prisma+engines@2.22.0-21.60cc71d884972ab4e897f0277c4b84383dddaf6c/node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x)
Default Engines Hash : 60cc71d884972ab4e897f0277c4b84383dddaf6c
Studio : 0.379.0
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:44 (24 by maintainers)
Top Results From Across the Web
How do I bypass the 4.5MB body size limit of Vercel ...
When trying to request or upload a large file from a Serverless Function, you may have seen a 413: FUNCTION_PAYLOAD_TOO_LARGE error.
Read more >NextJs: The Serverless Function exceeds the maximum size ...
It appears that when bundling the serverless function vercel is pulling in ALL assets within your project. So 50.55MB is likely the size...
Read more >File Size limit exceeded when trying to deploy app ... - Reddit
gitignore file. This means the deployment build will fail when importing the project in vercel's website since there is no assets folder. So...
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, ... Error: The Serverless Function "index.py" is 79.31mb...
Read more >GolangRepo: Discover useful Go development resources
merry Add context to errors, including automatic stack capture, cause chains, ... Limits the concurrency of task execution, not the number of tasks...
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 Free
Top 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
Ok, so we figured out what is going on here and I need to document that for later:
2.22.0-dev.39
and2.22.0-dev.40
- and was shipped with2.22.0
.nexus-plugin-prisma
- which you are all using in your projects.2.23.0-dev
, which will of course also be included in2.23.0
.nexus-plugin-prisma
what triggered this bug in the CLI to become active.nexus-plugin-prisma
led to Prisma Client Postinstall and via that Prisma CLI and via that Prisma studio was triggered: https://github.com/vercel/nft/issues/203#issuecomment-840541429nexus-plugin-prisma
could break that inclusion: https://github.com/graphql-nexus/nexus-plugin-prisma/pull/1089/files Our reproduction project can successfully be published on Vercel when we change thenexus-plugin-prisma
dependency to that PR version: https://github.com/janpio/prisma-limit-repro/pull/11/filesCase closed. 📕
Left to do now is to maybe clean up
nexus-plugin-prisma
a bit and certainly add our reproduction project (Thanks @talentlessguy again!!) to our e2e tests with the failing dependency versions, then update to recent ones to make sure the problems are gone and will never come back (in this one specific combination).Yes, now I have a reproduction that I can poke.