__dirname undefined error in SvelteKit with custom Prisma output

7/10 High

When generating PrismaClient to a custom location in SvelteKit projects, Prisma produces code with undefined __dirname references, causing build and runtime failures.

Category
compatibility
Workaround
hack
Stage
build
Freshness
persistent
Scope
framework
Upstream
open
Recurring
No
Buyer Type
team
Maintainer
active

Sources

Collection History

Query: “What are the most common pain points with Prisma for developers in 2025?4/4/2026

`__dirname is not defined` when generating PrismaClient to custom location, w/ SvelteKit

Created: 4/4/2026Updated: 4/4/2026