suiyueou
suiyueou
PPrisma
Created by suiyueou on 5/5/2025 in #help-and-questions
[prisma-client]: Accessing SQLite database with a relative path reports [P2021] error
When I set the output path of the generator client to a directory inside prisma/*, the generated client files contain subtle differences:
// ~/prisma/client/internal/class.ts

- "relativePath": ".."

// ~/generated/client/internal/class.ts
- "relativePath": "../../prisma"
// ~/prisma/client/internal/class.ts

- "relativePath": ".."

// ~/generated/client/internal/class.ts
- "relativePath": "../../prisma"
This causes the database to be inaccessible during development when using relative paths (e.g., file:./dev.db) with SQLite, resulting in a [P2021] error. For details and reproduction steps, please refer to the GitHub issue: https://github.com/prisma/prisma/issues/27085
2 replies