NextJS Prisma Errors 6.7.0

Hey, i try to setup NextJS with Prisma 6.7.0 (provider: 'prisma-client') and Better-Auth But i become some Errors:
⨯ ./src/prisma/client.ts:17:1
Module not found: Can't resolve './enums.js'
15 |
16 | import * as runtime from "@prisma/client/runtime/client"
> 17 | import * as $Enums from "./enums.js"
| ^
18 | import * as $Class from "./internal/class.js"
19 | import * as Prisma from "./internal/prismaNamespace.js"

⚠ ./node_modules/pg/lib/native/client.js
Module not found: Can't resolve 'pg-native' in 'F:\Aufträge\...\<project>\node_modules\pg\lib\native'
⨯ ./src/prisma/client.ts:17:1
Module not found: Can't resolve './enums.js'
15 |
16 | import * as runtime from "@prisma/client/runtime/client"
> 17 | import * as $Enums from "./enums.js"
| ^
18 | import * as $Class from "./internal/class.js"
19 | import * as Prisma from "./internal/prismaNamespace.js"

⚠ ./node_modules/pg/lib/native/client.js
Module not found: Can't resolve 'pg-native' in 'F:\Aufträge\...\<project>\node_modules\pg\lib\native'
Prisma Schema:
generator client {
provider = "prisma-client"
output = "../src/prisma"
previewFeatures = ["queryCompiler", "driverAdapters"]
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client"
output = "../src/prisma"
previewFeatures = ["queryCompiler", "driverAdapters"]
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
Prisma Config:
import 'dotenv/config';
import path from 'node:path';
import { defineConfig } from 'prisma/config';

export default defineConfig({
earlyAccess: true,
schema: path.join('prisma'),
});
import 'dotenv/config';
import path from 'node:path';
import { defineConfig } from 'prisma/config';

export default defineConfig({
earlyAccess: true,
schema: path.join('prisma'),
});
Packages:
"@prisma/adapter-pg": "^6.7.0",
"@prisma/client": "^6.7.0",
"better-auth": "^1.2.7",
"next": "^15.3.1",
"pg": "^8.15.6",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"@prisma/adapter-pg": "^6.7.0",
"@prisma/client": "^6.7.0",
"better-auth": "^1.2.7",
"next": "^15.3.1",
"pg": "^8.15.6",
"react": "^19.1.0",
"react-dom": "^19.1.0",
5 Replies
Prisma AI Help
Ahoy, knowledge seeker! I'm the Prisma AI Help Bot. Do you want a dev's response that might take a hot second, or an AI answer that's ready before your next coffee sip? Either way, your question is important to us.
DevPanda
DevPandaOP2w ago
db class:
import { env } from "@/env";
import { PrismaPg } from "@prisma/adapter-pg";
import { PrismaClient } from "@/prisma/client";

const createPrismaClient = () => {
const adapter = new PrismaPg({ connectionString: env.DATABASE_URL });
return new PrismaClient({
adapter,
log: env.NODE_ENV === "development" ? ["query", "error", "warn"] : ["error"]
});
}

const globalForPrisma = globalThis as unknown as {
prisma: ReturnType<typeof createPrismaClient> | undefined;
};

export const db = globalForPrisma.prisma ?? createPrismaClient();

if (env.NODE_ENV !== "production") globalForPrisma.prisma = db;
import { env } from "@/env";
import { PrismaPg } from "@prisma/adapter-pg";
import { PrismaClient } from "@/prisma/client";

const createPrismaClient = () => {
const adapter = new PrismaPg({ connectionString: env.DATABASE_URL });
return new PrismaClient({
adapter,
log: env.NODE_ENV === "development" ? ["query", "error", "warn"] : ["error"]
});
}

const globalForPrisma = globalThis as unknown as {
prisma: ReturnType<typeof createPrismaClient> | undefined;
};

export const db = globalForPrisma.prisma ?? createPrismaClient();

if (env.NODE_ENV !== "production") globalForPrisma.prisma = db;
DevPanda
DevPandaOP2w ago
GitHub
[6.7.0] NextJS - Prisma · Issue #27079 · prisma/prisma
Bug description See bug. It occurs directly at startup Severity 🚨 Critical: Data loss, app crash, security issue Reproduction https://github.com/devpanda0/prisma-nextjs-repro pull the repo, install...
Nurul
Nurul6d ago
Thank you for providing a reproduction. I'll reproduce this and share it with team internally
DevPanda
DevPandaOP5d ago
Okay, thank you. I hope it can be fixed quickly 🙂 maybe any news? Can you reproduce the error?

Did you find this page helpful?