Skip to content

Scheduling infrastructure for absolutely everyone.

fix: prisma client binary cannot be found on vercel (#23772)

Alex van Andel4ed0901957be
diff --git a/apps/api/v1/next.config.js b/apps/api/v1/next.config.js
index 0ee86f8ae71..c4679ab2b38 100644
--- a/apps/api/v1/next.config.js
+++ b/apps/api/v1/next.config.js
@@ -1,5 +1,6 @@
const { withAxiom } = require("next-axiom");
const { withSentryConfig } = require("@sentry/nextjs");
+const { PrismaPlugin } = require("@prisma/nextjs-monorepo-workaround-plugin");
const plugins = [withAxiom];
@@ -14,6 +15,12 @@ const nextConfig = {
"@calcom/prisma",
"@calcom/trpc",
],
+ webpack: (config, { isServer }) => {
+ if (isServer) {
+ config.plugins = [...config.plugins, new PrismaPlugin()];
+ }
+ return config;
+ },
async headers() {
return [
{
diff --git a/apps/api/v1/package.json b/apps/api/v1/package.json
index d60cdccbd8f..f50f227aec3 100644
--- a/apps/api/v1/package.json
+++ b/apps/api/v1/package.json
@@ -30,6 +30,7 @@
"@calcom/lib": "*",
"@calcom/prisma": "*",
"@calcom/trpc": "*",
+ "@prisma/nextjs-monorepo-workaround-plugin": "^6.16.1",
"@sentry/nextjs": "^9.15.0",
"bcryptjs": "^2.4.3",
"memory-cache": "^0.2.0",
diff --git a/apps/web/next.config.js b/apps/web/next.config.js
index 65cbf718e62..029b42e38eb 100644
--- a/apps/web/next.config.js
+++ b/apps/web/next.config.js
@@ -2,6 +2,7 @@ require("dotenv").config({ path: "../../.env" });
const englishTranslation = require("./public/static/locales/en/common.json");
const { withAxiom } = require("next-axiom");
const { version } = require("./package.json");
+const { PrismaPlugin } = require("@prisma/nextjs-monorepo-workaround-plugin");
const {
i18n: { locales },
} = require("./next-i18next.config");
@@ -254,6 +255,8 @@ const nextConfig = (phase) => {
})
);
+ config.plugins = [...config.plugins, new PrismaPlugin()];
+
config.externals.push("formidable");
}
diff --git a/apps/web/package.json b/apps/web/package.json
index d7c718f425b..85c6a52afe0 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -59,6 +59,7 @@
"@hookform/resolvers": "^2.9.7",
"@next-auth/prisma-adapter": "^1.0.4",
"@next/bundle-analyzer": "^15.5.2",
+ "@prisma/nextjs-monorepo-workaround-plugin": "^6.16.1",
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-collapsible": "^1.0.0",
"@radix-ui/react-dialog": "^1.0.4",
diff --git a/yarn.lock b/yarn.lock
index 9c4d28e1545..d98a10afbcf 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2802,6 +2802,7 @@ __metadata:
"@calcom/trpc": "*"
"@calcom/tsconfig": "*"
"@calcom/types": "*"
+ "@prisma/nextjs-monorepo-workaround-plugin": ^6.16.1
"@sentry/nextjs": ^9.15.0
bcryptjs: ^2.4.3
memory-cache: ^0.2.0
@@ -4251,6 +4252,7 @@ __metadata:
"@next-auth/prisma-adapter": ^1.0.4
"@next/bundle-analyzer": ^15.5.2
"@playwright/test": ^1.45.3
+ "@prisma/nextjs-monorepo-workaround-plugin": ^6.16.1
"@radix-ui/react-avatar": ^1.0.4
"@radix-ui/react-collapsible": ^1.0.0
"@radix-ui/react-dialog": ^1.0.4
@@ -11733,6 +11735,13 @@ __metadata:
languageName: node
linkType: hard
+"@prisma/nextjs-monorepo-workaround-plugin@npm:^6.16.1":
+ version: 6.16.1
+ resolution: "@prisma/nextjs-monorepo-workaround-plugin@npm:6.16.1"
+ checksum: df29824e2e420b50e707ea3af765a3b8a4d8be15af876adc1f177e7ad44d5d8fc968b2ba50f117196772bb5e6c28d50c49a3d4004c20a00fef6a26f2782366d0
+ languageName: node
+ linkType: hard
+
"@prisma/prisma-schema-wasm@npm:5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2":
version: 5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2
resolution: "@prisma/prisma-schema-wasm@npm:5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2"