Skip to content

Fix: Remove --no-engine flag from Prisma generate#38

Open
moonejon wants to merge 1 commit into
mainfrom
fix/prisma-engine-generation
Open

Fix: Remove --no-engine flag from Prisma generate#38
moonejon wants to merge 1 commit into
mainfrom
fix/prisma-engine-generation

Conversation

@moonejon

Copy link
Copy Markdown
Owner

Summary

Fixes the Prisma error on main branch: "Error validating datasource db: the URL must start with the protocol prisma:// or prisma+postgres://"

Root Cause

The --no-engine flag in the postinstall script was preventing Prisma from generating local query engine binaries. This flag is only appropriate when exclusively using Prisma Accelerate, but the application supports both local PostgreSQL and Prisma Accelerate connections.

Changes

  • Removed --no-engine flag from postinstall script in package.json
  • This allows Prisma to generate the necessary query engine binaries for local PostgreSQL connections

Technical Details

The application already handles both connection types correctly in /src/lib/prisma.ts:

  • For prisma:// or prisma+postgres:// URLs: Uses Prisma Accelerate extension
  • For standard postgresql:// URLs: Uses local query engine

The --no-engine flag was forcing Accelerate-only mode, breaking local development.

Testing

  • Confirmed dev server starts without Prisma errors
  • Verified both / and /library pages load successfully
  • Database queries execute properly with local PostgreSQL

Impact

This is a critical bug fix for local development. The application now works correctly with:

  • Local PostgreSQL databases (development)
  • Prisma Accelerate (production)

Generated with Claude Code

The --no-engine flag was preventing Prisma from generating the local
query engine binaries, which are required when using a standard
PostgreSQL connection URL (postgresql://). This flag should only be
used when exclusively using Prisma Accelerate (prisma:// URLs).

The application already handles both scenarios correctly in
src/lib/prisma.ts by conditionally applying the Accelerate extension
only when the database URL uses the prisma:// protocol.

This fix allows the application to work with both:
- Local PostgreSQL (postgresql://)
- Prisma Accelerate (prisma:// or prisma+postgres://)

Fixes Prisma error: "the URL must start with the protocol prisma://
or prisma+postgres://"

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 11, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
penumbra Ready Ready Preview Comment Nov 11, 2025 10:25pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant