tRPC failing on static pages (app router) build on Vercel
When deploying my Next.js app on Vercel (using v13 app router), I come across an error I struggle with during the build phase, when tRPC attempts to retrieve the first data.
I assume the error comes from the API endpoint that exists but fails to execute (else I have another error when
NEXT_PUBLIC_VERCEL_URL
is wrong, when I try to log the request, nothing shows). I added logs (lines starting with ###...
) and can notice that the URL is good. It works well on my machine if I set NEXT_PUBLIC_VERCEL_URL
to localhost
, I can only reproduce on Vercel.
Any idea why on Vercel my API endpoint doesn't work well during static pages generation?
1 Reply
Anyway, I'll drop tRPC until they officially support App Router... 😅