P
Prisma•4mo ago
suiyueou

[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
GitHub
When the output path is inside the prisma directory, the database...
Bug description When the output path is relative to the prisma directory (e.g., ./client), accessing the SQLite database using a relative path like ./dev.db fails with a P2021 error: { "err&qu...
4 Replies
Prisma AI Help
Prisma AI Help•4mo ago
You decided to hold for human wisdom. We'll chime in soon! Meanwhile, #ask-ai is there if you need a quick second opinion.
suiyueou
suiyueouOP•4mo ago
@Jon Harrell Could you please take a look at this issue?
jonfanz
jonfanz•4mo ago
Thanks for sharing and making a GitHub issue! I see that our Eng team has already taken a look so I would carry on the conversation there 🙂
suiyueou
suiyueouOP•4mo ago
Perfect! Really appreciate you keeping me updated! :heart:

Did you find this page helpful?