trpc prefetch fails when building app
tRPC fails to get the data when it is build the application as the tRPC server cannot run when building.
Any thoughts on how to fix this issue?
3 Replies
I found this solution here:
tRPC fetch breaking when building Next project - Theo's Typesafe Cult
I'm testing out tRPC, and I've tried fetching some asynchronous data. This only happens during
pnpm build
, dev mode works completely fine.
The fetch is prefetched in the page, and then actually fetched within the component.
It always errors in this way when it gets to the static page generation step.
```bash
a [TRPCClientError]: fetch fail...Solution