hhhyh
hhhyh2y ago

TRPCClientError - No "query"-procedure on path "user.all"

Im using react native expo, prisma, trpc and the postgres database is on railway I have run the following commands: npx prisma generate and pnpm db-push so its up to date. attached in the screenshots is the code for the routes, user model in prisma, and error messages. Not sure why it cant recognise the user.all or the user.byId path ? Interesting is that the failureReason is null the first time then after that it is for the above error message in the title of the post.
12 Replies
hhhyh
hhhyhOP2y ago
I setup this project by using https://github.com/t3-oss/create-t3-turbo
hhhyh
hhhyhOP2y ago
the autocomplete seems to recognize it
hhhyh
hhhyhOP2y ago
--- ignore for now I think I may have found the issue ----
isitayush
isitayush2y ago
Hey @hhhyh, I know this is late but what was the issue? I've encountered a similar issue so hope I find something here.
hhhyh
hhhyhOP2y ago
Hey @isitayush , I can't remember exactly how I fixed it but normally when I get that error it is due to me not rebuilding my nextjs backend which has the updated files in it. So I just run: next build and that usually fixes it. What is the error that you're getting?
isitayush
isitayush2y ago
Similar error, TRPCClientError: No "query"-procedure on path "myRouter.procedure". It worked fine when I added it for the first time although I'm not sure what change I made that caused it to error like that. Other procedures work fine and autocomplete seems to recognize this procedure although it errors out on console. I didn't make any change that could induce such an error. Even verified via git status.
hhhyh
hhhyhOP2y ago
what stack are you using trpc with ?
isitayush
isitayush2y ago
T3!
hhhyh
hhhyhOP2y ago
have you tried rebuilding your nextjs backend?
isitayush
isitayush2y ago
Trying it. rm rf the modules and .next and restart the dev server! A moment. Ah, It worked ^_^!! It was very strange though. I'm unsure what caused it.
hhhyh
hhhyhOP2y ago
glad to hear! yeah sometimes it just does that, but the old trick of turning it off and on again seems to fix it 😂
isitayush
isitayush2y ago
Aahah 😂, Should've done it before bothering here. I was almost out of breath since this thread is 2.9 months old. Thank you so much hhhyh!🫡

Did you find this page helpful?