-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getServerSideProps returns undefined
on client side transition after adding locales
#46730
Comments
Did you manage to solve this issue? I'm facing something similar: When navigating with next/link, sometimes the props from getServerSideProps get passed to the page, sometimes not. Weirdly only happens when deploying to Vercel or custom Docker image. Running a prod build locally runs without problems. |
After hours of searching, this issue seems related. getServerSideProps sometimes fire, sometimes not. In my case the target page is dynamic one and relies on getServerSideProps to fetch locales. In dev mode no issues, of course. |
I'm having the same issue. Deployed on AWS Amplify. Works perfectly locally. |
From what I understood and how I solved the issue I was facing. My issue was due to Proper solution to translation issue is quite obvious. Since that is a dynamic page, all of the content should be fetched in https://github.com/i18next/i18next-http-backend/tree/master/example/next |
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
Data fetching (gS(S)P, getInitialProps), Routing (next/router, next/navigation, next/link)
Link to the code that reproduces this issue
https://github.com/abdofola/Abdallah-Money-Tracker
To Reproduce
clone the repo in the link above, follow the instructions in the
readme.md
to get started.Describe the Bug
After successfully running the project locally, try to navigate from
home
tostatement
page you will have and error in the browser console:the
id
comes fromgetServersideProps
, which has the following code:the weird thing though, when deploying to
vercel
the error happens the other way around, i.e when navigating fromstatement
tohome
page and not vice versaExpected Behavior
expect
getServerSideProps
to run on client side transition, thereforesession
should not beundefined
Which browser are you using? (if relevant)
chrome
How are you deploying your application? (if relevant)
vercel
The text was updated successfully, but these errors were encountered: