From 4821764a4f3c7a3360438520551fea6dcdd06d72 Mon Sep 17 00:00:00 2001 From: dmitriylaukhin Date: Sat, 25 Apr 2026 14:23:02 +0500 Subject: [PATCH] Fix Prisma 7 + Turbopack RSC compatibility by adding serverExternalPackages Next.js 16 with Turbopack bundles @prisma/client into the RSC bundle, causing it to be treated as a client module and creating 'temporary client references'. This triggers the 'Cannot access toStringTag on the server' error whenever Prisma result objects are used in Server Components. Adding serverExternalPackages tells Turbopack to treat these as native Node.js packages and keep them out of the RSC bundle. Co-Authored-By: Claude Sonnet 4.6 --- next.config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/next.config.ts b/next.config.ts index deaa0a9..d766244 100644 --- a/next.config.ts +++ b/next.config.ts @@ -3,6 +3,7 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { output: "standalone", transpilePackages: ["unified", "remark-parse"], + serverExternalPackages: ["@prisma/client", "@prisma/adapter-pg", "pg"], }; export default nextConfig;