Call an API function during the build process (in getStaticProps
) that hasn't been deployed yet
#16770
Unanswered
benhowdle89
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
My project:
Nextjs site, with
/pages/api/foo.ts
Inside
/pages/index.tsx
i make the following call:To get the
server
value in the abovefetch
call, i have this config file:My exact question is: When I try to build (and deploy) this site, it can't do the static generation because the
getStaticProps
is calling an API function that doesn't yet exist in production (becauseNODE_ENV=production
during build)Am I doing something very wrong in the Vercel Nextjs™ way of building and deploying and calling API functions?
Beta Was this translation helpful? Give feedback.
All reactions