PrismaP
Prisma4w ago
2 replies
xcr90

Prisma 7: Generated Client w/ custom output ignores prisma.config.ts / fails to connect

Hi everyone, I'm trying out Prisma 7 with a hybrid setup (SQLite for local, Postgres for prod).
I'm generating a local client to a custom path (src/generated/prisma-local).

The Issue:
Runtime fails because the client seems unable to resolve the datasource URL from
prisma.config.ts
when using a custom output location.
- Error: TypeError: Cannot read properties of undefined (reading 'clientMethod') (internal client error during init).
- If I try new PrismaClient({ datasourceUrl: ... }), I get PrismaClientConstructorValidationError: Unknown property datasourceUrl.

Setup:
1. schema.local.prisma has provider = "sqlite" using the new v7 style (no
url
field, relying on config).
2.
prisma.config.ts
defines the datasource url via process.env.DATABASE_URL.
3. Generator output is configured to ../src/generated/prisma-local.
4. Runtime: Bun v1.3.2 (also reproduced on Node v25).

Workaround found:
Injecting url = env("DATABASE_URL") explicitly back into the datasource block of the schema fixes it.

Question:
Is this a known limitation with custom output paths in v7? Does
prisma.config.ts
discovery fail if the client is not in the default location?

Thanks!
Was this page helpful?