404 TRPCError: no query procedure on path
Hi, this is my entire standalone tRPC server:
and here is my tRPC client:
but when i use it with
trpc.foo.useQuery(), this the response:
What am i doing wrong? I already tried removing /trpc from the url that the client uses which also resulted in 404.7 Replies
Maybe the URL is just wrong? Try to change this
url: "http://localhost:3000/trpc" to this: url: "http://localhost:3000"
At least it looks to me like you are not setting it up on any path, so the default should just be http://localhost:3000i did try that, i've already mentioned it ^^
maybe i didn't try without slash
Is the server behind a reverse proxy? What do you get when you call
http://localhost:3000/foo?that can't be the issue, the response is clear
no reverse proxy
the request comes through
but i'll check /foo when i'm back home
not sure what to expect tho
bc trpc isn't rest
It should give you something like "400 Bad Request" and not a 404 if the path is correct.
@thomasplayschess yeah the issue was simply that i tried
localhost:4321/ instead of localhost:4321 as the URL for the link.
it works now :)
thanksAwesome, glad I could help! 🙂