schema.prisma not found after changing the location
Hello,
I'm new in NuxtJS and I'm trying to add Prisma to my NuxtJS environment. So I followed the steps https://nuxt.com/modules/prisma.
When I do that, prisma auto create :
- A ./lib folder with prisma.ts file inside
- A ./prisma folder with schema.prisma file inside
The thing is I want to place the schema.prisma file in my ./server/prisma folder and not in a prisma folder at the root of the NuxtJS project.
For doing that I followed the steps here : https://www.prisma.io/docs/orm/prisma-schema/overview/location#prisma-schema-location so I have in my package.json file :
The problem is when I do a npm run dev or prisma migrate dev the CLI didn't find the schema.prisma file and recreate the file at the default location (./prisma/schema.prisma) (Screenshot 1)
BUT at the end of the processes he said "Prisma schema loaded from server\prisma\schema.prisma" (Screenshot 2)
Any idea why that happened ?
11 Replies
Hey ๐
Thank you for reporting this behaviour.
This looks like a bug to me. Do you mind creating a GitHub Issue with this link so that our ORM team can have a look?
https://github.com/prisma/prisma/issues/new?assignees=&labels=kind%2Fbug&projects=&template=bug_report.yml
Hello, thank you for your response!
I didn't create an issue but I will do it right away.
@Nurul (Prisma) I created the ticket, is it good or is there information missing ?
Link : https://github.com/prisma/prisma/issues/25389
GitHub
schema.prisma not found after changing the location in NuxtJS ยท Iss...
Bug description In a NuxtJS project, when you change the location of the schema.prisma in the package.json and you do a npm run dev at the start of the process it says that the schema is not found ...
Looks good! Thanks for creating the issue ๐
Np ! Now I created an issue but maybe one day I'll solve the issues...
@Nurul (Prisma) I found a way to fix the issue, how can I submit it ?
I do a fork of the nuxt prisma project (https://github.com/prisma/nuxt-prisma), add my change, test my fix and do a merge request ?
Hey @Aguix
Yes, that would be great! Our concerned team will respond to your PR ๐
Ok ! Sorry for all the questions, but on my fork I do the changes on the main branch or I create a new one ?
I think you can directly make changes on main branch of your fork and then create a PR from main branch of your fork to the official nuxt-prisma repository
Ok I will do that then. Thanks !
No worries