fix: restore DATABASE_URL in schema.prisma for Prisma 7 runtime client #1
Reference in New Issue
Block a user
Delete Branch "claude/reverent-proskuriakova"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
url = env("DATABASE_URL")to thedatasource dbblock inprisma/schema.prismaPrismaClientConstructorValidationErrorcrashing next-auth's OAuth callback handlerRoot Cause
In Prisma 7,
prisma.config.tsonly configures the CLI (migrations, db push, etc.) — it is not read by the runtimePrismaClient. With nourlin the datasource block, the generated client defaulted toengineType = "client"(WASM), which requires either a database adapter or Prisma Accelerate URL to be passed to the constructor. Since neither was provided, every database call threw aPrismaClientConstructorValidationError, which surfaced as a next-authadapter_error_getUserByAccounton OAuth callback.Test plan
adapter_error_getUserByAccountDATABASE_URL=file:/app/data/dev.dbis set in the container environment🤖 Generated with Claude Code