Inline/bundle the contents of the prisma schema on generate
See original GitHub issueWe could close a whole class of issues where the schema is not found (https://github.com/prisma/prisma/labels/topic%3A ENOENT schema.prisma) by inlining the contents of the schema.prisma
directly into the generated index.js
. Our logic happens to break usually when code is bundled (nextjs, svelte, webpack).
When code is bundled to another location, our lookup paths for the schema do not make sense any longer. We have logic to at best find the original generated folder, which works at best but has not guarantee it could find the correct folder and fails especially on monorepos.
A solution to this is to directly embed the prisma schema, which needs to be passed to the engines. Side note: We might experience the same thing again for sqlite databases since we resolve their normal location relatively to the generated client.
Issue Analytics
- State:
- Created a year ago
- Reactions:33
- Comments:19 (6 by maintainers)
Top GitHub Comments
Hey everyone, I have a testing version to share. If you have some time, could you please give a try?
npm i prisma@3.15.0-integration-fix-inline-schema.5
andnpm i @prisma/client@3.15.0-integration-fix-inline-schema.5
Looking for your feedback 😃
I’m thinking/hoping this would finally allow us to move our repo over from Yarn v3 to pnpm. As it is, Prisma does not seem to behave well in a pnpm monorepo. I’d love to help, but TBH not sure I have the time to dive in on the Prisma codebase ATM. Happy to help test things, though. Cheers!