How to prevent prerender error for static page that fetches data from serverless API
I'm trying to have a static props get defined by data retrieved from an endpoint on
/api/hello
from a t3 app. Running next dev
works just fine, but when running vercel build
, I get this error:
(cut to fit character limit)
I see that fetch failed
so it might just be that the env var isn't defined at the time, since I'm fetching from await fetch(http://${process.env.NEXT_PUBLIC_VERCEL_URL}/api/graphql)
. The thing is I already have .env.development.local
defined and I see this msg: info - Loaded env from /Users/alann/code/next-ssg-edge/.env.local
. Thank you.0 Replies