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 <noreply@anthropic.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user