Invalid `db.teamMember.findMany()` invocation in
api | /Users/bogdan/Documents/proiecte/epfa/api/src/services/teamMembers/teamMembers.ts:6:24
api |
api | 3 import { db } from 'src/lib/db'
api | 4
api | 5 export const teamMembers = () => {
api | → 6 return db.teamMember.findMany(
api | The table `main.TeamMember` does not exist in the current database.
Running yarn rw dev will build but app will not work. Will have the error from above in console and the UI will show Something went wrong.
I’m using rw version 0.46. did a fresh typescript project.
The only way i made it work was deleting node modules from api and web. But doing this all the time seems strange.
I don’t have a home page for the app but have some pages build in /team, /members, etc.
I can’t recall exactly but the core issue was multiple Prisma clients and there was one in the api directory node_modules and also maybe in the root node_modules.
I did delete both those directories and then ran commands:
Something in this lines i did before posting this(as mentioned in the post body). The issue persists after vscode restart and the only way i can make it work is by doing it al over again. I guess this is not the intended flow.
So I just came across this… I’ll try and reproduce, but the root cause of the issue is that prisma seems to generate another client inside api/node_modules/.prisma - so when you’re running the api server it’s picking the client from the nested api/node_modules rather than the root ./node_modules/.prisma
I found that deleting the generated client in the api folder fixes it:
rm -rf api/node_modules/.prisma
Any idea how this keeps happening for you @bogdan2510 - like a series of steps to help me reproduce reliably?
Thanks for the confirmation @bogdan2510 - I’ve identified this as a Prisma + yarn workspaces issue, I will follow up again with the prisma team shortly, but I’m sure they’re working hard to resolve.
If this works for you, I would say this is the preferred workaround right now.
OR
b) Downgrade prisma version to 3.8.1 (the last known working version, without issues) - by adding resolutions to both api/package.json and the root package.json
Hi @bobwatcherx the masked error message of “Something went wrong” is appropriate for the response, but you should see the original error on the api development log.