getProviders not working with getInitialProps and getStaticProps for me #1029
Unanswered
JakubKoralewski
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Here's the branch I'm trying to deploy. This is the page that's using the
getStaticProps
. I have verified it works withgetServerSideProps
.Error with
getStaticProps
:Error with
getInitialProps
:I tried setting the
NEXTAUTH_URL
env var from the heroku review app, but it didn't help. JakubKoralewski/lets-watch-it-together@4d9a136It got fixed when using
getServerSideProps
. It's weird because it works withnpm run dev
, and it works withnpm run build
whenNODE_ENV
is not set toproduction
. This is the weird part.I'm familiar with https://nextjs.org/docs/basic-features/data-fetching#write-server-side-code-directly
"You should not fetch an API route from getStaticProps...", so if this is because of that then I can create a feature request instead.
I also conditionally enable
next-pwa
onNODE_ENV=production
so I tried disablingnext-pwa
and reverted back to usinggetStaticProps
withNODE_ENV=production npm run build
and it's the same error as the previousgetStaticProps
one.Beta Was this translation helpful? Give feedback.
All reactions