Describe the bug
In my unit test, sometimes npx prisma generate fails (fleaky test)
[NOTE]
I'm using Multi-file prisma schema feature.
I'd like to get more information about the supported status of the Multi-file Prisma Schema in the README.md.
(optional) create other schema files in prisma/schema/<your_table>.prisma
npx prisma generate --no-hints
Environment variables loaded from .env
Prisma schema loaded from prisma/schema
Error:
✔ Generated Prisma Client (v5.20.0) to ./node_modules/@prisma/client in 973ms
ENOENT: no such file or directory, open '/app/prisma/src/__generated__/fabbrica/index.js'
Expected behavior
$ npx prisma generate --no-hints
Environment variables loaded from .env
Prisma schema loaded from prisma/schema
✔ Generated Prisma Client (v5.19.0) to ./node_modules/@prisma/client in 276ms
✔ Generated fabbrica to ./prisma/src/__generated__/fabbrica in 4.10s
NOTE:
Generally, prisma-fabbrica generate the code into
src/__generated__/fabbrica
But in my project prisma-fabbrica ouptuts to
prisma/src/__generated__/fabbrica
This in itself is not a problem.
I believe this behavior occurs due to the Multi-file schema setup. Does prisma-fabbrica use a relative path of schema.prisma?
I manually run mv prisma/src/__generated__ src/__generated__ each time.
Anyway, the main issue is that prisma-fabbrica's code generation is failing during npx prisma generate.
Environment (please complete the following information):
Database kind: MySQL 8.0.36
Node.js version: v20.11.0
@prisma/client version: 5.19.0
TypeScript version: 5.5.4
Your Schema
I have prisma/schema/schema.prisma and mutiple schema files (about 50 files)
Describe the bug In my unit test, sometimes
npx prisma generate
fails (fleaky test)[NOTE] I'm using Multi-file prisma schema feature. I'd like to get more information about the supported status of the Multi-file Prisma Schema in the README.md.
Prisma Documentation https://www.prisma.io/docs/orm/prisma-schema/overview/location#multi-file-prisma-schema
To Reproduce
"prismaSchemaFolder"
to previewFetures in schema.prismamv prisma/schema.prisma prisma/schema/schema.prisma
prisma/schema/<your_table>.prisma
Expected behavior
NOTE: Generally, prisma-fabbrica generate the code into
src/__generated__/fabbrica
But in my project prisma-fabbrica ouptuts to
prisma/src/__generated__/fabbrica
This in itself is not a problem. I believe this behavior occurs due to the Multi-file schema setup. Does prisma-fabbrica use a relative path of
schema.prisma
? I manually runmv prisma/src/__generated__ src/__generated__
each time.Anyway, the main issue is that prisma-fabbrica's code generation is failing during
npx prisma generate
.Environment (please complete the following information):
MySQL 8.0.36
v20.11.0
@prisma/client
version:5.19.0
5.5.4
Your Schema
I have
prisma/schema/schema.prisma
and mutiple schema files (about 50 files)Your tsconfig.json
Paste TypeScript configuration if you have problem about TypeScript compilation.