esanchezvz
Can't do server side data fetching with RSC.
Whenever I try to use a proxy client to fetch data in a React Server Component with Nextjs14, I get an error
error: TRPCClientError: Unexpected token < in JSON at position 0
Likely trpc is returning HTML though I don't know why. Now if instead of fetching with a RSC, I trigger the data fetching via a "server action" I get the following error
The wierd thing is that when using client side fetching, via react query, everything works.
I've looked at issues, docs, gpt but I can't seam to fix this error. I've looked at similar implementations like create-t3-app
but nothing works so far. Not sure what I'm doing wrong. Some direction would be greatly appreciated.
Here's a link to a repo that recreates this issue. https://github.com/esanchezvz/trpc-nextjs-express-turborepo5 replies