Prisma MySQL findMany problem with chirp tutorial

So my experience is in raw JS and PHP etc, and I have been trying the chirp tutorial to dive into this tech stack. I started chirp about 2.5 months ago before some work commitments called me away. I am now back giving it another try with a fresh install and I am STUMPED. Previously I managed to get posts appearing and had started styling (let's just say, I got up to about 30 mins in through the tutorial https://www.youtube.com/watch?v=YkOSUVzOAA4). Currently I have fallen a bit short of that because I continually get an error from prisma regarding the findMany query. Note: I'm going a bit different from the tutorial by using my own local mysql server and am using authjs instead of clerk. Also note the first version of chirp I made used prisma v4.11.0 while this recent attempt uses v5.0.0.
prisma:error
Operation 'findMany' for model 'Post' does not match any query.
prisma:error
Operation 'findMany' for model 'Post' does not match any query.
(Full error below) So naturally I thought I had a typo. Nope. I made sure to previously do a prisma db push. I checked the database to ensure the tables and content were pushed correctly. I then compared against my previous attempt (which works) and found the code the exact same minus some changes to t3-app in the past months (esp. in how index.ts was presented, however, the impacts of these changes appeared negligible). Bouncing ideas and tests around the most logical thing would be a change to a library that stopped it working - logically prisma. I could find nothing that should impact the code. On a whim I decided to change prisma from my mysql instance to an sqlite instance. A quick db push and restart and now everything is working fine without changing any of the code, only the prisma schema provider from mysql to sqlite and the url. So... can someone explain what is happening and how I can fix it since I'm a big ol' n00b with this tech. Otherwise, if some more experienced prisma folks can replicate this, is this a bug that prisma might need to know about?
Solution:
Whelp, it's solved and I have no idea how. Things started working when I commented out the mysql url and provider in the prisma schema while adding the sqlite provider and url.... and then it kept working when I commented out the sqlite provider and url and uncommented the mysql provider and url. Literally no other code was changed. throws hands up in the air I'm guessing the swap between the db types rejigged something in prisma? I'll leave this all here in case someone else comes across this problem and they can try this as a 'solution'....
Jump to solution
2 Replies
corcube
corcube11mo ago
Full error message:
prisma:error
Invalid `prisma.post.findMany()` invocation:


Operation 'findMany' for model 'Post' does not match any query.
PrismaClientUnknownRequestError:
Invalid `prisma.post.findMany()` invocation:


Operation 'findMany' for model 'Post' does not match any query.
at zr.handleRequestError (E:\Onedrive\Documents\server\Node\bicker2\bicker2\node_modules\@prisma\client\runtime\library.js:122:8480)
at zr.handleAndLogRequestError (E:\Onedrive\Documents\server\Node\bicker2\bicker2\node_modules\@prisma\client\runtime\library.js:122:7697)
at zr.request (E:\Onedrive\Documents\server\Node\bicker2\bicker2\node_modules\@prisma\client\runtime\library.js:122:7307)
at async eval (webpack-internal:///(api)/./src/server/api/routers/posts.ts:14:20)
at async resolveMiddleware (file:///E:/Onedrive/Documents/server/Node/bicker2/bicker2/node_modules/@trpc/server/dist/index.mjs:416:30)
at async callRecursive (file:///E:/Onedrive/Documents/server/Node/bicker2/bicker2/node_modules/@trpc/server/dist/index.mjs:452:32)
at async resolve (file:///E:/Onedrive/Documents/server/Node/bicker2/bicker2/node_modules/@trpc/server/dist/index.mjs:482:24)
at async inputToProcedureCall (file:///E:/Onedrive/Documents/server/Node/bicker2/bicker2/node_modules/@trpc/server/dist/resolveHTTPResponse-8d917a7c.mjs:46:22)
at async Promise.all (index 0)
at async resolveHTTPResponse (file:///E:/Onedrive/Documents/server/Node/bicker2/bicker2/node_modules/@trpc/server/dist/resolveHTTPResponse-8d917a7c.mjs:173:37)
at async file:///E:/Onedrive/Documents/server/Node/bicker2/bicker2/node_modules/@trpc/server/dist/nodeHTTPRequestHandler-2b341e93.mjs:67:9
at async file:///E:/Onedrive/Documents/server/Node/bicker2/bicker2/node_modules/@trpc/server/dist/adapters/next.mjs:44:9 {
clientVersion: '5.0.0'
}
prisma:error
Invalid `prisma.post.findMany()` invocation:


Operation 'findMany' for model 'Post' does not match any query.
PrismaClientUnknownRequestError:
Invalid `prisma.post.findMany()` invocation:


Operation 'findMany' for model 'Post' does not match any query.
at zr.handleRequestError (E:\Onedrive\Documents\server\Node\bicker2\bicker2\node_modules\@prisma\client\runtime\library.js:122:8480)
at zr.handleAndLogRequestError (E:\Onedrive\Documents\server\Node\bicker2\bicker2\node_modules\@prisma\client\runtime\library.js:122:7697)
at zr.request (E:\Onedrive\Documents\server\Node\bicker2\bicker2\node_modules\@prisma\client\runtime\library.js:122:7307)
at async eval (webpack-internal:///(api)/./src/server/api/routers/posts.ts:14:20)
at async resolveMiddleware (file:///E:/Onedrive/Documents/server/Node/bicker2/bicker2/node_modules/@trpc/server/dist/index.mjs:416:30)
at async callRecursive (file:///E:/Onedrive/Documents/server/Node/bicker2/bicker2/node_modules/@trpc/server/dist/index.mjs:452:32)
at async resolve (file:///E:/Onedrive/Documents/server/Node/bicker2/bicker2/node_modules/@trpc/server/dist/index.mjs:482:24)
at async inputToProcedureCall (file:///E:/Onedrive/Documents/server/Node/bicker2/bicker2/node_modules/@trpc/server/dist/resolveHTTPResponse-8d917a7c.mjs:46:22)
at async Promise.all (index 0)
at async resolveHTTPResponse (file:///E:/Onedrive/Documents/server/Node/bicker2/bicker2/node_modules/@trpc/server/dist/resolveHTTPResponse-8d917a7c.mjs:173:37)
at async file:///E:/Onedrive/Documents/server/Node/bicker2/bicker2/node_modules/@trpc/server/dist/nodeHTTPRequestHandler-2b341e93.mjs:67:9
at async file:///E:/Onedrive/Documents/server/Node/bicker2/bicker2/node_modules/@trpc/server/dist/adapters/next.mjs:44:9 {
clientVersion: '5.0.0'
}
Solution
corcube
corcube11mo ago
Whelp, it's solved and I have no idea how. Things started working when I commented out the mysql url and provider in the prisma schema while adding the sqlite provider and url.... and then it kept working when I commented out the sqlite provider and url and uncommented the mysql provider and url. Literally no other code was changed. throws hands up in the air I'm guessing the swap between the db types rejigged something in prisma? I'll leave this all here in case someone else comes across this problem and they can try this as a 'solution'.