fix: restore DATABASE_URL in schema.prisma for Prisma 7 runtime client #1

Merged
jason merged 1 commits from claude/reverent-proskuriakova into master 2026-03-12 23:46:49 -05:00
Owner

Summary

  • Restores url = env("DATABASE_URL") to the datasource db block in prisma/schema.prisma
  • Fixes PrismaClientConstructorValidationError crashing next-auth's OAuth callback handler

Root Cause

In Prisma 7, prisma.config.ts only configures the CLI (migrations, db push, etc.) — it is not read by the runtime PrismaClient. With no url in the datasource block, the generated client defaulted to engineType = "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 a PrismaClientConstructorValidationError, which surfaced as a next-auth adapter_error_getUserByAccount on OAuth callback.

Test plan

  • Rebuild Docker image and verify OAuth login completes without adapter_error_getUserByAccount
  • Confirm DATABASE_URL=file:/app/data/dev.db is set in the container environment

🤖 Generated with Claude Code

## Summary - Restores `url = env("DATABASE_URL")` to the `datasource db` block in `prisma/schema.prisma` - Fixes `PrismaClientConstructorValidationError` crashing next-auth's OAuth callback handler ## Root Cause In Prisma 7, `prisma.config.ts` only configures the **CLI** (migrations, db push, etc.) — it is not read by the runtime `PrismaClient`. With no `url` in the datasource block, the generated client defaulted to `engineType = "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 a `PrismaClientConstructorValidationError`, which surfaced as a next-auth `adapter_error_getUserByAccount` on OAuth callback. ## Test plan - [ ] Rebuild Docker image and verify OAuth login completes without `adapter_error_getUserByAccount` - [ ] Confirm `DATABASE_URL=file:/app/data/dev.db` is set in the container environment 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jason added 1 commit 2026-03-12 23:46:26 -05:00
Prisma 7's prisma.config.ts only configures the CLI, not the runtime
PrismaClient. Without url in the datasource block, the generated client
defaults to engineType "client" (WASM) which requires an adapter,
causing next-auth adapter errors on OAuth callback.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jason merged commit bfb7cd98c8 into master 2026-03-12 23:46:49 -05:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jason/wfh#1