multi-file schema doesn't work @6.7.0
whenever i run
prisma generate
i get the following error:
i don't get an error if i remove the Test
model from my main.prisma
file, but then it doesn't generate any types. and if i run prisma db push
no models are added.
here's my setup
prisma.config.ts
prisma/main.prisma
prisma/models/races.prisma
profiles.prisma
i'm importing my generated client for my prisma service.14 Replies
You selected to wait for the human sages. They'll share their wisdom soon.
Grab some tea while you wait, or check out
#ask-ai
if you'd like a quick chat with the bot anyway!Do you get the same error if you don't use the queryCompiler preview feature?
i use this folder concept and its work without problems https://www.prisma.io/docs/orm/prisma-schema/overview/location#multi-file-prisma-schema
Prisma Schema Location and Configuration | Prisma Documentation
Documentation regarding proper location of Prisma Schema including default naming and multiple files.
that's what i was doing.
yes, i tried with and without. same thing
Hi everyone ! Any update on this ? I have the same problem but only in prod for some reason. I already followed the new directory structure and edited my package.json accordingly. Any suggestion ?
Well i think i pointed out the problem here
Are you also using a Prisma config file?
well no, i tried out but the fact that i need to add dotenv inside my project when using nuxt is a no no for my superior
i came back to single prisma schema
You don’t need to add dotenv. That’s only required if the env vars you need are defined in a .env file. It’s how the ORM loads those values under the hood anyway 🙂
@begot I think your problem is that you’re defining
schema
in your config as a file instead of a directorybut the problem was because our prod container do not have the package.json file
true, but as we are using docker we do need env so kinda stuck on this
i see, the docs said to define it somewhere, which included the config
Yep! I meant that you should have a directory there instead of your
main.prisma
file, if you have multiple prisma files. I think something like this should work:
😭 if this works i'm going to be pissed, but thank you, will try now
😅 works like a charm, thank you, i can't believe i missed that @Jon Harrell

Happy it’s working 🙂 I’ll go ahead and mark this as resolved.