prisma: @prisma/engines weights 113 MB and causes maximum size limit error on Vercel

Bug 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

  1. 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

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 3
  • Comments: 44 (24 by maintainers)

Most upvoted comments

Ok, so we figured out what is going on here and I need to document that for later:

  • This was indeed caused by a change in Prisma CLI (Prisma Studio more exactly) between 2.22.0-dev.39 and 2.22.0-dev.40 - and was shipped with 2.22.0.
  • Our end to end tests did not trigger the failure, as it only appears in relation with nexus-plugin-prisma - which you are all using in your projects.
  • We could easily fix the problem in Prisma CLI already which we did in early 2.23.0-dev, which will of course also be included in 2.23.0.
  • Left us with the problem that we did not understand what is going on in nexus-plugin-prisma what triggered this bug in the CLI to become active.
  • After help from Vercel we could confirm that 1 specific line in 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-840541429
  • We could also confirm that a simple change in nexus-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 the nexus-plugin-prisma dependency to that PR version: https://github.com/janpio/prisma-limit-repro/pull/11/files

Case 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.

This will definitely land in production very soon so you can switch back to latest of Prisma CLI and Client πŸ‘ (Expect it later today tomorrow.)

Looks like it’s not an issue anymore? I’m using Prisma 2.23 on an old project and it deploys fine

@janpio I am running into this error on 2.23 WITHOUT nexus-plugin-prisma

My bundle size has increased a lot recently and I am not sure why. Vercel logs below with NEXT_DEBUG_FUNCTION_SIZE=1

I am using nx workspace with my prisma client in a lib. It worked fine until recent versions of prisma (2.20 if I recall). I temporarily fixed the issue on one PR by adding N-API preview feature which reduced my function size slightly and got it from just over the 50mb limit to just below the 50mb limit, but in a newer PR where my code size increased I am back over the 50mb limit despite having N-API enabled

Not sure if it has an effect, but I am using pnpm


18:03:19.224 | Analyzing source code...
-- | --
18:03:20.168 | Installing build runtime...
18:03:22.602 | Build runtime installed: 2.434s
18:03:24.917 | Looking up build cache...
18:03:25.135 | Build cache found. Downloading...
18:03:35.334 | Build cache downloaded [187.60 MB]: 10198.752ms
18:03:36.475 | Running "install" command: `npx pnpm i --frozen-lockfile`...
18:03:37.301 | Lockfile is up-to-date, resolution step is skipped
18:03:37.597 | Progress: resolved 1, reused 0, downloaded 0, added 0
18:03:37.792 | Packages: +20 -16
18:03:37.793 | ++++++++++++++++++++----------------
18:03:38.597 | Progress: resolved 20, reused 0, downloaded 18, added 18
18:03:39.257 | WARN  Failed to find "/fsevents/2.3.2" in lockfile during hoisting. Next aliases will not be hoisted: fsevents
18:03:39.819 | Progress: resolved 20, reused 0, downloaded 20, added 20, done
18:03:39.920 | .../node_modules/@prisma/engines postinstall$ node download/index.js
18:03:43.274 | .../node_modules/@prisma/engines postinstall: Done
18:03:43.277 | .../prisma@2.23.0/node_modules/prisma preinstall$ node scripts/preinstall-entry.js
18:03:43.349 | .../prisma@2.23.0/node_modules/prisma preinstall: Done
18:03:43.350 | .../prisma@2.23.0/node_modules/prisma install$ node scripts/install-entry.js
18:03:43.422 | .../prisma@2.23.0/node_modules/prisma install: Done
18:03:43.469 | .../node_modules/@prisma/client postinstall$ node scripts/postinstall.js
18:03:43.989 | .../node_modules/@prisma/client postinstall: Environment variables loaded from .env
18:03:44.786 | .../node_modules/@prisma/client postinstall: prisma:warn The postinstall script automatically ran `prisma generate` and did not find your `prisma/schema.prisma`.
18:03:44.786 | .../node_modules/@prisma/client postinstall: If you have a Prisma schema file in a custom path, you will need to run
18:03:44.786 | .../node_modules/@prisma/client postinstall: `prisma generate --schema=./path/to/your/schema.prisma` to generate Prisma Client.
18:03:44.786 | .../node_modules/@prisma/client postinstall: If you do not have a Prisma schema file yet, you can ignore this message.
18:03:45.125 | .../node_modules/@prisma/client postinstall: Done
18:03:45.863 | dependencies:
18:03:45.863 | - @prisma/client 2.22.1
18:03:45.863 | + @prisma/client 2.23.0
18:03:45.863 | - @sentry/nextjs 6.3.6
18:03:45.863 | + @sentry/nextjs 6.3.6
18:03:45.863 | - @trpc/next 6.1.1
18:03:45.863 | + @trpc/next 6.1.1
18:03:45.863 | - babel-plugin-superjson-next 0.3.0
18:03:45.863 | + babel-plugin-superjson-next 0.3.0
18:03:45.863 | - next 10.2.2
18:03:45.864 | + next 10.2.0
18:03:45.864 | - next-auth 3.23.0
18:03:45.864 | + next-auth 3.23.0
18:03:45.864 | - storybook-addon-next-router 2.0.4
18:03:45.864 | + storybook-addon-next-router 2.0.4
18:03:45.864 | devDependencies:
18:03:45.864 | - @nrwl/next 12.3.4
18:03:45.864 | + @nrwl/next 12.3.4
18:03:45.864 | - prisma 2.22.1
18:03:45.864 | + prisma 2.23.0
18:03:45.885 | Detected Next.js version: 10.2.0
18:03:46.072 | Running "npx nx build agent-pay --with-deps --prod --skip-nx-cache"
18:03:48.233 | > nx run agent-pay:build:production
18:03:49.103 | >  NX  Running target codegen for 3 project(s):
18:03:49.103 | - legacy-mimir
18:03:49.103 | - legacy-vor
18:03:49.104 | - db
18:03:49.104 | β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
18:03:49.132 | > nx run db:codegen
18:03:49.748 | Environment variables loaded from .env
18:03:50.521 | Prisma schema loaded from libs/db/prisma/src/schema.prisma
18:03:52.901 | βœ” Generated Prisma Client (2.23.0) to ./dist/libs/db/prisma in 270ms
18:03:52.901 | βœ” Generated DBML Schema to ./libs/db/prisma/src/dbml in 17ms
18:03:52.901 | You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client
18:03:52.902 | ```
18:03:52.902 | import { PrismaClient } from './dist/libs/db/prisma'
18:03:52.902 | const prisma = new PrismaClient()
18:03:52.902 | ```
18:03:52.963 | > nx run legacy-vor:codegen
18:03:53.884 | [16:03:53] Parse configuration [started]
18:03:53.885 | [16:03:53] Parse configuration [completed]
18:03:53.885 | [16:03:53] Generate outputs [started]
18:03:53.886 | [16:03:53] Generate ./libs/legacy/vor/src/generated/graphql.ts [started]
18:03:53.886 | [16:03:53] Load GraphQL schemas [started]
18:03:58.586 | [16:03:58] Load GraphQL schemas [completed]
18:03:58.586 | [16:03:58] Load GraphQL documents [started]
18:03:58.601 | [16:03:58] Load GraphQL documents [completed]
18:03:58.601 | [16:03:58] Generate [started]
18:03:58.755 | [16:03:58] Generate [completed]
18:03:58.756 | [16:03:58] Generate ./libs/legacy/vor/src/generated/graphql.ts [completed]
18:03:58.756 | [16:03:58] Generate outputs [completed]
18:04:04.868 | > nx run legacy-mimir:codegen
18:04:05.765 | [16:04:05] Parse configuration [started]
18:04:05.766 | [16:04:05] Parse configuration [completed]
18:04:05.766 | [16:04:05] Generate outputs [started]
18:04:05.767 | [16:04:05] Generate ./libs/legacy/mimir/src/generated/graphql.ts [started]
18:04:05.767 | [16:04:05] Load GraphQL schemas [started]
18:04:06.594 | [16:04:06] Load GraphQL schemas [completed]
18:04:06.594 | [16:04:06] Load GraphQL documents [started]
18:04:06.619 | [16:04:06] Load GraphQL documents [completed]
18:04:06.619 | [16:04:06] Generate [started]
18:04:06.836 | [16:04:06] Generate [completed]
18:04:06.836 | [16:04:06] Generate ./libs/legacy/mimir/src/generated/graphql.ts [completed]
18:04:06.836 | [16:04:06] Generate outputs [completed]
18:04:13.275 | β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
18:04:13.275 | >  NX   SUCCESS  Running target "codegen" succeeded
18:04:13.933 | > nx run agent-pay:next-build:production --outputPath=.
18:04:15.363 | info  - Loaded env from apps/agent-pay/.env
18:04:16.102 | info  - Using webpack 4. Reason: custom webpack configuration in next.config.js https://nextjs.org/docs/messages/webpack5
18:04:16.430 | withNx() plugin: Detected Vercel build environment, applying "experimental-serverless-trace" target
18:04:17.177 | info  - Using webpack 4. Reason: custom webpack configuration in next.config.js https://nextjs.org/docs/messages/webpack5
18:04:17.179 | info  - Checking validity of types...
18:04:30.186 | info  - Creating an optimized production build...
18:04:30.979 | info  - Using external babel configuration from /vercel/path0/apps/agent-pay/.babelrc
18:04:33.485 | info  - Using external babel configuration from /vercel/path0/libs/utils/sentry/.babelrc
18:04:33.905 | info  - Using external babel configuration from /vercel/path0/libs/authentication/.babelrc
18:04:33.925 | info  - Using external babel configuration from /vercel/path0/libs/common/.babelrc
18:04:37.460 | info  - Using external babel configuration from /vercel/path0/libs/utils/segment/.babelrc
18:04:37.464 | info  - Using external babel configuration from /vercel/path0/libs/utils/rollout/.babelrc
18:04:37.489 | info  - Using external babel configuration from /vercel/path0/libs/authorization/.babelrc
18:04:37.537 | info  - Using external babel configuration from /vercel/path0/libs/db/trpc/client/.babelrc
18:04:37.972 | info  - Using external babel configuration from /vercel/path0/libs/legacy/moment/.babelrc
18:04:37.974 | info  - Using external babel configuration from /vercel/path0/libs/legacy/mimir/.babelrc
18:04:37.976 | info  - Using external babel configuration from /vercel/path0/libs/legacy/vor/.babelrc
18:04:46.420 | [BABEL] Note: The code generator has deoptimised the styling of /vercel/path0/dist/libs/db/prisma/index.js as it exceeds the max of 500KB.
18:04:53.840 | [BABEL] Note: The code generator has deoptimised the styling of /vercel/path0/dist/libs/db/prisma/runtime/index.js as it exceeds the max of 500KB.
18:05:04.259 | > Found 29 release files
18:05:04.272 | > Analyzing 29 sources
18:05:04.503 | > Rewriting sources
18:05:04.815 | > Adding source map references
18:05:05.975 | > Bundled 29 files for upload
18:05:06.749 | > Uploaded release files to Sentry
18:05:06.909 | > File upload complete (processing pending on server)
18:05:06.910 | Source Map Upload Report
18:05:06.910 | Scripts
18:05:06.910 | ~/_next/server/13.9f1052b17cb133a980ef.js
18:05:06.910 | ~/_next/server/pages/_app.js
18:05:06.910 | ~/_next/server/pages/_document.js
18:05:06.910 | ~/_next/server/pages/_error.js
18:05:06.910 | ~/_next/server/pages/agent/[id].js
18:05:06.911 | ~/_next/server/pages/agents.js
18:05:06.911 | ~/_next/server/pages/api/mimir/graphql.js
18:05:06.911 | ~/_next/server/pages/api/vor/graphql.js
18:05:06.911 | ~/_next/server/pages/auth/signin.js
18:05:06.911 | ~/_next/server/pages/auth/signout.js
18:05:06.911 | ~/_next/server/pages/index.js
18:05:06.911 | ~/_next/server/pages/logged-in.js
18:05:06.911 | ~/_next/server/pages/yard.js
18:05:06.912 | ~/_next/server/ssr-module-cache.js
18:05:06.912 | Minified Scripts
18:05:06.912 | ~/_next/server/pages/api/auth/[...nextauth].js (sourcemap at [...nextauth].js.map)
18:05:06.912 | Source Maps
18:05:06.912 | ~/_next/server/13.9f1052b17cb133a980ef.js.map
18:05:06.912 | ~/_next/server/pages/_app.js.map
18:05:06.912 | ~/_next/server/pages/_document.js.map
18:05:06.913 | ~/_next/server/pages/_error.js.map
18:05:06.913 | ~/_next/server/pages/agent/[id].js.map
18:05:06.913 | ~/_next/server/pages/agents.js.map
18:05:06.913 | ~/_next/server/pages/api/auth/[...nextauth].js.map
18:05:06.913 | ~/_next/server/pages/api/mimir/graphql.js.map
18:05:06.913 | ~/_next/server/pages/api/vor/graphql.js.map
18:05:06.913 | ~/_next/server/pages/auth/signin.js.map
18:05:06.914 | ~/_next/server/pages/auth/signout.js.map
18:05:06.914 | ~/_next/server/pages/index.js.map
18:05:06.914 | ~/_next/server/pages/logged-in.js.map
18:05:06.914 | ~/_next/server/pages/yard.js.map
18:05:32.510 | > Found 84 release files
18:05:32.526 | > Analyzing 84 sources
18:05:32.860 | > Rewriting sources
18:05:33.537 | > Adding source map references
18:05:35.288 | > Bundled 84 files for upload
18:05:36.427 | > Uploaded release files to Sentry
18:05:36.607 | > File upload complete (processing pending on server)
18:05:36.608 | Source Map Upload Report
18:05:36.608 | Scripts
18:05:36.608 | ~/_next/server/13.9f1052b17cb133a980ef.js
18:05:36.608 | ~/_next/server/pages/_app.js
18:05:36.608 | ~/_next/server/pages/_document.js
18:05:36.608 | ~/_next/server/pages/_error.js
18:05:36.608 | ~/_next/server/pages/agent/[id].js
18:05:36.608 | ~/_next/server/pages/agents.js
18:05:36.609 | ~/_next/server/pages/api/mimir/graphql.js
18:05:36.609 | ~/_next/server/pages/api/vor/graphql.js
18:05:36.609 | ~/_next/server/pages/auth/signin.js
18:05:36.609 | ~/_next/server/pages/auth/signout.js
18:05:36.609 | ~/_next/server/pages/index.js
18:05:36.609 | ~/_next/server/pages/logged-in.js
18:05:36.609 | ~/_next/server/pages/yard.js
18:05:36.609 | ~/_next/server/ssr-module-cache.js
18:05:36.609 | ~/_next/static/r3WPQUx_0chYrCCjPlK9i/_ssgManifest.js
18:05:36.609 | Minified Scripts
18:05:36.609 | ~/_next/server/pages/api/auth/[...nextauth].js (sourcemap at [...nextauth].js.map)
18:05:36.609 | ~/_next/static/chunks/25.63c289130052019be216.js (sourcemap at 25.63c289130052019be216.js.map)
18:05:36.609 | ~/_next/static/chunks/2f179c7d.f775645be48a42584449.js (sourcemap at 2f179c7d.f775645be48a42584449.js.map)
18:05:36.609 | ~/_next/static/chunks/385447c0e4e0be4775d546b7e9af718844e69059.221f163af54b57da42dd.js (sourcemap at 385447c0e4e0be4775d546b7e9af718844e69059.221f163af54b57da42dd.js.map)
18:05:36.609 | ~/_next/static/chunks/54ed3978.39d5688ac57ec0c2b2ba.js (sourcemap at 54ed3978.39d5688ac57ec0c2b2ba.js.map)
18:05:36.609 | ~/_next/static/chunks/674b5c70.a751003776842146359a.js (sourcemap at 674b5c70.a751003776842146359a.js.map)
18:05:36.609 | ~/_next/static/chunks/6a2ce0ce60a6102ea546b195b77a435e750d1c95.3d8fa2f111f4e08339e3.js (sourcemap at 6a2ce0ce60a6102ea546b195b77a435e750d1c95.3d8fa2f111f4e08339e3.js.map)
18:05:36.609 | ~/_next/static/chunks/a22d7b0a0b0507f6daaa624ec1e650cc133cfbd1.407724b6ac81118411d0.js (sourcemap at a22d7b0a0b0507f6daaa624ec1e650cc133cfbd1.407724b6ac81118411d0.js.map)
18:05:36.609 | ~/_next/static/chunks/c85c00a3.d986baad68475c70246d.js (sourcemap at c85c00a3.d986baad68475c70246d.js.map)
18:05:36.609 | ~/_next/static/chunks/ce61a669ffb34e930a63f5bd17c6e5157d8dde99.47d4c5618f66e6abdf44.js (sourcemap at ce61a669ffb34e930a63f5bd17c6e5157d8dde99.47d4c5618f66e6abdf44.js.map)
18:05:36.609 | ~/_next/static/chunks/commons.a7bff84a38aa419f0fe5.js (sourcemap at commons.a7bff84a38aa419f0fe5.js.map)
18:05:36.609 | ~/_next/static/chunks/db9c4727d218a8b6788016e90f400f0b0902933d.a06ccc125cbfcfaeab9f.js (sourcemap at db9c4727d218a8b6788016e90f400f0b0902933d.a06ccc125cbfcfaeab9f.js.map)
18:05:36.609 | ~/_next/static/chunks/e431992a3e33d6fda88663cff8ac4a148672e11f.e95f2d85352b1d347228.js (sourcemap at e431992a3e33d6fda88663cff8ac4a148672e11f.e95f2d85352b1d347228.js.map)
18:05:36.609 | ~/_next/static/chunks/f69bbb46.c05b59d304144231d6ae.js (sourcemap at f69bbb46.c05b59d304144231d6ae.js.map)
18:05:36.609 | ~/_next/static/chunks/f9c45baebc58af58b2d09b0511999eefe683b72f.3b63ff200b4c09e0aa33.js (sourcemap at f9c45baebc58af58b2d09b0511999eefe683b72f.3b63ff200b4c09e0aa33.js.map)
18:05:36.609 | ~/_next/static/chunks/main-6296c5822161096325e8.js (sourcemap at main-6296c5822161096325e8.js.map)
18:05:36.609 | ~/_next/static/chunks/pages/_app-3f779f649f767130855d.js (sourcemap at _app-3f779f649f767130855d.js.map)
18:05:36.609 | ~/_next/static/chunks/pages/_error-82bbca6c00087b20a0ca.js (sourcemap at _error-82bbca6c00087b20a0ca.js.map)
18:05:36.609 | ~/_next/static/chunks/pages/agent/[id]-67744440d97ab280982d.js (sourcemap at [id]-67744440d97ab280982d.js.map)
18:05:36.609 | ~/_next/static/chunks/pages/agents-359fbecb79aa467d1e90.js (sourcemap at agents-359fbecb79aa467d1e90.js.map)
18:05:36.609 | ~/_next/static/chunks/pages/auth/signin-c04e9cbe089eabf69f9b.js (sourcemap at signin-c04e9cbe089eabf69f9b.js.map)
18:05:36.609 | ~/_next/static/chunks/pages/auth/signout-dc1b85d20939f631c4ed.js (sourcemap at signout-dc1b85d20939f631c4ed.js.map)
18:05:36.609 | ~/_next/static/chunks/pages/index-9de4cbd0fc990c47da95.js (sourcemap at index-9de4cbd0fc990c47da95.js.map)
18:05:36.609 | ~/_next/static/chunks/pages/logged-in-cfd9eebfd7078a294cc3.js (sourcemap at logged-in-cfd9eebfd7078a294cc3.js.map)
18:05:36.610 | ~/_next/static/chunks/pages/yard-e14e6d323c32769a57d6.js (sourcemap at yard-e14e6d323c32769a57d6.js.map)
18:05:36.610 | ~/_next/static/chunks/polyfills-2439cf82be4a08c0281b.js (sourcemap at polyfills-2439cf82be4a08c0281b.js.map)
18:05:36.610 | ~/_next/static/chunks/webpack-f87ffba474f0bb3449c6.js (sourcemap at webpack-f87ffba474f0bb3449c6.js.map)
18:05:36.610 | ~/_next/static/r3WPQUx_0chYrCCjPlK9i/_buildManifest.js (no sourcemap ref)
18:05:36.610 | - warning: could not determine a source map reference (Could not auto-detect referenced sourcemap for ~/_next/static/r3WPQUx_0chYrCCjPlK9i/_buildManifest.js.)
18:05:36.610 | Source Maps
18:05:36.610 | ~/_next/server/13.9f1052b17cb133a980ef.js.map
18:05:36.610 | ~/_next/server/pages/_app.js.map
18:05:36.610 | ~/_next/server/pages/_document.js.map
18:05:36.610 | ~/_next/server/pages/_error.js.map
18:05:36.610 | ~/_next/server/pages/agent/[id].js.map
18:05:36.610 | ~/_next/server/pages/agents.js.map
18:05:36.610 | ~/_next/server/pages/api/auth/[...nextauth].js.map
18:05:36.610 | ~/_next/server/pages/api/mimir/graphql.js.map
18:05:36.610 | ~/_next/server/pages/api/vor/graphql.js.map
18:05:36.610 | ~/_next/server/pages/auth/signin.js.map
18:05:36.610 | ~/_next/server/pages/auth/signout.js.map
18:05:36.610 | ~/_next/server/pages/index.js.map
18:05:36.610 | ~/_next/server/pages/logged-in.js.map
18:05:36.610 | ~/_next/server/pages/yard.js.map
18:05:36.610 | ~/_next/static/chunks/25.63c289130052019be216.js.map
18:05:36.610 | ~/_next/static/chunks/2f179c7d.f775645be48a42584449.js.map
18:05:36.610 | ~/_next/static/chunks/385447c0e4e0be4775d546b7e9af718844e69059.221f163af54b57da42dd.js.map
18:05:36.610 | ~/_next/static/chunks/54ed3978.39d5688ac57ec0c2b2ba.js.map
18:05:36.610 | ~/_next/static/chunks/674b5c70.a751003776842146359a.js.map
18:05:36.610 | ~/_next/static/chunks/6a2ce0ce60a6102ea546b195b77a435e750d1c95.3d8fa2f111f4e08339e3.js.map
18:05:36.610 | ~/_next/static/chunks/a22d7b0a0b0507f6daaa624ec1e650cc133cfbd1.407724b6ac81118411d0.js.map
18:05:36.610 | ~/_next/static/chunks/c85c00a3.d986baad68475c70246d.js.map
18:05:36.610 | ~/_next/static/chunks/ce61a669ffb34e930a63f5bd17c6e5157d8dde99.47d4c5618f66e6abdf44.js.map
18:05:36.610 | ~/_next/static/chunks/commons.a7bff84a38aa419f0fe5.js.map
18:05:36.610 | ~/_next/static/chunks/db9c4727d218a8b6788016e90f400f0b0902933d.a06ccc125cbfcfaeab9f.js.map
18:05:36.610 | ~/_next/static/chunks/e431992a3e33d6fda88663cff8ac4a148672e11f.e95f2d85352b1d347228.js.map
18:05:36.610 | ~/_next/static/chunks/f69bbb46.c05b59d304144231d6ae.js.map
18:05:36.610 | ~/_next/static/chunks/f9c45baebc58af58b2d09b0511999eefe683b72f.3b63ff200b4c09e0aa33.js.map
18:05:36.611 | ~/_next/static/chunks/main-6296c5822161096325e8.js.map
18:05:36.611 | ~/_next/static/chunks/pages/_app-3f779f649f767130855d.js.map
18:05:36.611 | ~/_next/static/chunks/pages/_error-82bbca6c00087b20a0ca.js.map
18:05:36.611 | ~/_next/static/chunks/pages/agent/[id]-67744440d97ab280982d.js.map
18:05:36.611 | ~/_next/static/chunks/pages/agents-359fbecb79aa467d1e90.js.map
18:05:36.611 | ~/_next/static/chunks/pages/auth/signin-c04e9cbe089eabf69f9b.js.map
18:05:36.611 | ~/_next/static/chunks/pages/auth/signout-dc1b85d20939f631c4ed.js.map
18:05:36.611 | ~/_next/static/chunks/pages/index-9de4cbd0fc990c47da95.js.map
18:05:36.611 | ~/_next/static/chunks/pages/logged-in-cfd9eebfd7078a294cc3.js.map
18:05:36.611 | ~/_next/static/chunks/pages/yard-e14e6d323c32769a57d6.js.map
18:05:36.611 | ~/_next/static/chunks/polyfills-2439cf82be4a08c0281b.js.map
18:05:36.611 | ~/_next/static/chunks/webpack-f87ffba474f0bb3449c6.js.map
18:05:36.611 | ~/_next/static/css/38121e383cb6d3f501ec.css.map
18:05:37.237 | info  - Compiled successfully
18:05:37.237 | info  - Collecting page data...
18:05:38.869 | info  - Generating static pages (0/7)
18:05:39.793 | info  - Generating static pages (1/7)
18:05:39.820 | info  - Generating static pages (3/7)
18:05:39.838 | info  - Generating static pages (5/7)
18:05:39.966 | info  - Generating static pages (7/7)
18:05:39.966 | info  - Finalizing page optimization...
18:05:39.978 | Page                                                           Size     First Load JS
18:05:39.978 | β”Œ Ξ» /                                                          1.89 kB         627 kB
18:05:39.978 | β”œ   /_app                                                      0 B             625 kB
18:05:39.978 | β”œ β—‹ /404                                                       3.77 kB         629 kB
18:05:39.978 | β”œ β—‹ /agent/[id]                                                5.91 kB         781 kB
18:05:39.978 | β”œ β—‹ /agents                                                    18.7 kB         794 kB
18:05:39.978 | β”œ Ξ» /api/auth/[...nextauth]                                    0 B             625 kB
18:05:39.978 | β”œ Ξ» /api/mimir/graphql                                         0 B             625 kB
18:05:39.978 | β”œ Ξ» /api/vor/graphql                                           0 B             625 kB
18:05:39.978 | β”œ β—‹ /auth/signin                                               599 B           626 kB
18:05:39.978 | β”œ β—‹ /auth/signout                                              612 B           626 kB
18:05:39.978 | β”œ Ξ» /logged-in                                                 401 B           626 kB
18:05:39.978 | β”” β—‹ /yard                                                      7.39 kB         633 kB
18:05:39.978 | + First Load JS shared by all                                  625 kB
18:05:39.978 | β”œ chunks/2f179c7d.f77564.js                                  37.1 kB
18:05:39.978 | β”œ chunks/54ed3978.39d568.js                                  89.3 kB
18:05:39.979 | β”œ chunks/6a2ce0ce60a6102ea546b195b77a435e750d1c95.3d8fa2.js  5.35 kB
18:05:39.979 | β”œ chunks/a22d7b0a0b0507f6daaa624ec1e650cc133cfbd1.407724.js  23 kB
18:05:39.979 | β”œ chunks/ce61a669ffb34e930a63f5bd17c6e5157d8dde99.47d4c5.js  65.9 kB
18:05:39.979 | β”œ chunks/commons.a7bff8.js                                   4.99 kB
18:05:39.979 | β”œ chunks/db9c4727d218a8b6788016e90f400f0b0902933d.a06ccc.js  73.4 kB
18:05:39.979 | β”œ chunks/e431992a3e33d6fda88663cff8ac4a148672e11f.e95f2d.js  11.3 kB
18:05:39.979 | β”œ chunks/f69bbb46.c05b59.js                                  24.7 kB
18:05:39.979 | β”œ chunks/f9c45baebc58af58b2d09b0511999eefe683b72f.3b63ff.js  93.9 kB
18:05:39.979 | β”œ chunks/main.6296c5.js                                      8.83 kB
18:05:39.979 | β”œ chunks/pages/_app.3f779f.js                                186 kB
18:05:39.979 | β”œ chunks/webpack.f87ffb.js                                   1.24 kB
18:05:39.979 | β”” css/38121e383cb6d3f501ec.css                               1.55 kB
18:05:39.979 | Ξ»  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
18:05:39.979 | β—‹  (Static)  automatically rendered as static HTML (uses no initial props)
18:05:39.979 | ●  (SSG)     automatically generated as static HTML + JSON (uses getStaticProps)
18:05:39.979 | (ISR)     incremental static regeneration (uses revalidate in getStaticProps)
18:05:41.045 | β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
18:05:41.045 | >  NX   SUCCESS  Running target "build" succeeded
18:05:41.050 | >  NX   CLOUD  See run details at https://nx.app/runs/23xck2cWenF
18:06:28.514 | Traced Next.js server files in: 47.425s
18:06:49.193 | Serverless function size info
18:06:49.194 | Serverless Function's pages: index.js, logged-in.js
18:06:49.195 | Large Dependencies  Uncompressed size  Compressed size
18:06:49.195 | pages/index.js                 487 kB           114 kB
18:06:49.195 | All dependencies              1.07 MB           292 kB
18:06:49.195 | Serverless Function's page: api/auth/[...nextauth].js
18:06:49.212 | Large Dependencies                                               Uncompressed size  Compressed size
18:06:49.212 | dist/libs/db                                                               45.3 MB          15.5 MB
18:06:49.212 | node_modules/.pnpm/@sentry+cli@1.64.2                                      17.8 MB          6.71 MB
18:06:49.212 | node_modules/.pnpm/next@10.2.0_507781d099a67956587e23f5ac79078b              16 MB          3.48 MB
18:06:49.212 | node_modules/.pnpm/sass@1.32.13                                            4.02 MB           594 kB
18:06:49.212 | node_modules/.pnpm/typeorm@0.2.32                                          3.06 MB           513 kB
18:06:49.212 | node_modules/.pnpm/highlight.js@10.7.2                                     1.42 MB           459 kB
18:06:49.212 | node_modules/.pnpm/webpack@4.42.0                                          1.31 MB           357 kB
18:06:49.212 | node_modules/.pnpm/react-dom@17.0.2_react@17.0.2                           1.18 MB           290 kB
18:06:49.212 | node_modules/.pnpm/caniuse-lite@1.0.30001228                                686 kB           271 kB
18:06:49.212 | pages/api/auth/[...nextauth].js                                            1.83 MB           249 kB
18:06:49.212 | node_modules/.pnpm/iconv-lite@0.6.2                                         328 kB           179 kB
18:06:49.212 | node_modules/.pnpm/iconv-lite@0.4.24                                        323 kB           177 kB
18:06:49.212 | node_modules/.pnpm/terser@4.8.0                                             365 kB           103 kB
18:06:49.212 | node_modules/.pnpm/nodemailer@6.6.0                                         435 kB           100 kB
18:06:49.212 | All dependencies                                                            104 MB          31.7 MB
18:06:49.213 | Serverless Function's pages: api/mimir/graphql.js, api/vor/graphql.js
18:06:49.225 | Large Dependencies                                               Uncompressed size  Compressed size
18:06:49.225 | node_modules/.pnpm/@sentry+cli@1.64.2                                      17.8 MB          6.71 MB
18:06:49.225 | node_modules/.pnpm/next@10.2.0_507781d099a67956587e23f5ac79078b              16 MB          3.48 MB
18:06:49.225 | node_modules/.pnpm/sass@1.32.13                                            4.02 MB           594 kB
18:06:49.225 | node_modules/.pnpm/webpack@4.42.0                                          1.31 MB           357 kB
18:06:49.225 | node_modules/.pnpm/react-dom@17.0.2_react@17.0.2                           1.18 MB           290 kB
18:06:49.225 | node_modules/.pnpm/caniuse-lite@1.0.30001228                                686 kB           271 kB
18:06:49.225 | node_modules/.pnpm/iconv-lite@0.6.2                                         328 kB           179 kB
18:06:49.225 | node_modules/.pnpm/iconv-lite@0.4.24                                        323 kB           177 kB
18:06:49.225 | node_modules/.pnpm/terser@4.8.0                                             365 kB           103 kB
18:06:49.225 | All dependencies                                                           50.5 MB          14.5 MB
18:06:51.013 | Created all serverless functions in: 22.498s
18:07:05.317 | Failed to process build result for "api/auth/[...nextauth]". Data: {"type":"Lambda","zipBuffer":{"type":"Buffer","data":[80,75,3,4,20,0,0,8,8,0,216,128,180,82,235,58,148,11,209,0,0,0,21,1,0,0,4,0,0,0,46,101,110,118,141,142,189,110,131,48,24,69,119,158,194,82,102,28,18,40,49,149,24,18,176,212,42,212,68,169,169,200,100,249,.
18:07:05.574 | Error: The Serverless Function "api/auth/[...nextauth]" is 64.26mb which exceeds the maximum size limit of 50mb. Learn More: https://vercel.link/serverless-function-size

Another data point here: I was facing the same issue, but by installing @prisma/client@2.23.0-dev.9 and prisma@2.23.0-dev.9 it was fixed!

Thanks for your great work for the community πŸ‘ πŸ‘ πŸ‘

Make totally sense… so that’s gonna be fun to find out πŸ˜„

They should be there - we could of course remove those dependencies or delete them to fix the problem right now - but that would not generally solve it. These files should just not be included by Vercel when they create that archive to upload it to AWS as they are not actually needed by the function. Exactly that is happening in our e2e test that is succeeding with Nextjs to Vercel. But not here, so some of the other code confuses Vercel.

Hey @janpio I can’t really share the project and there’s a lot of bigger stuff there than prisma alone.

I’ll be off for a week, but I’ll do before upgrading.

Thanks a lot

PS: I’m just preparing some things to have easier reproducible examples on a bigger starter (like https://github.com/belgattitude/nextjs-monorepo-example/pull/36).

Hey @belgattitude, can you maybe open a new issue for your function? I would like to look into that as well because of you getting pretty close. If you just include the informatio oyu posted here, I think we can start debugging this.

As we at Prisma have a Nextjs project deployed to Vercel in our end to end tests, to make sure nothing goes wrong when we release a new version (actually with each commit we build a dev version that is run there), I know that this combination can result in a function of only 16MB - as it should: image

So it is probably one of the dependencies or configuration that @talentlessguy is using in his project (obvious candidate: webpack 5). I am currently looking into these one by one until I can pinpoint it.

Seems we will need to add another e2e test in the future to make sure this combination stays good (after we fix it of course).

Why do we have 2 times the query-engine-debian-openssl-1.1.x in 2 different directories ?

You should only have that locally, but @prisma/engines should not be included in the uploaded archive in the first place, as it is a dependency of a dev dependency, prisma CLI. Something seems to be messing with that detection for some reason.

(That is also the reason why the file exists twice - the generated client needs to be self contained as you can also generate to another location via output in the generator block of your schema, and some people then publish that folder as an Npm package, upload it as an artifact or many similar things).

So indeed, complex.

@janpio we’ll probably be impacted as well in the future… The binary size has slightly grow (80kb) but there’s something I’m wondering that could help.

Why do we have 2 times the query-engine-debian-openssl-1.1.x in 2 different directories ?

in ./node_modules/.prisma/client/

 ls -lah ./node_modules/.prisma/client/
total 49M
drwxrwxr-x 2 sebastien sebastien 4,0K mai    6 15:59 .
drwxrwxr-x 3 sebastien sebastien 4,0K mars  29 17:34 ..
-rw-rw-r-- 1 sebastien sebastien  19K mai    6 15:59 index-browser.js
-rw-rw-r-- 1 sebastien sebastien 2,3M mai    6 15:59 index.d.ts
-rw-rw-r-- 1 sebastien sebastien 5,3M mai    6 15:59 index.js
-rw-rw-r-- 1 sebastien sebastien  110 mai    6 15:59 package.json
-rwxrwxr-x 1 sebastien sebastien  41M mai    6 15:59 query-engine-debian-openssl-1.1.x
-rw-rw-r-- 1 sebastien sebastien  39K mai    6 15:59 schema.prisma

in ./node_modules/@prisma/engines

ls -lah ./node_modules/@prisma/engines
total 99M
drwxrwxr-x 4 sebastien sebastien 4,0K mai    6 15:59 .
drwxrwxr-x 5 sebastien sebastien 4,0K avril  7 15:24 ..
drwxrwxr-x 2 sebastien sebastien 4,0K mai    6 15:58 dist
drwxrwxr-x 2 sebastien sebastien 4,0K mai    6 15:58 download
-rwxrwxr-x 1 sebastien sebastien  19M mai    6 15:58 introspection-engine-debian-openssl-1.1.x
-rwxrwxr-x 1 sebastien sebastien  33M mai    6 15:58 migration-engine-debian-openssl-1.1.x
-rw-r--r-- 1 sebastien sebastien  646 avril 14 15:18 package.json
-rwxrwxr-x 1 sebastien sebastien 7,4M mai    6 15:58 prisma-fmt-debian-openssl-1.1.x
-rwxrwxr-x 1 sebastien sebastien  41M mai    6 15:58 query-engine-debian-openssl-1.1.x

Could we get rid of one, or symlinking in a post install ?

@janpio ok, please wait a few minutes while I’m bootrstraping a repo

FYI, it works fine with prisma and @prisma/client v2.21.2

@janpio I deploy it using vercel github integration