I have pages/index.tsx file on my NextJS project which has getServerSideProps
When I refresh the page it shows correct data on the page.
When I try to navigate from the "sign in" page to index.tsx it tries to fetch data from some_url/_next/data/some_weird_hash/index.json, but it is incorrect data from previous user that was signed in.
Appreciate any ideas or suggestions?
Locally it works fine, this issue only appears on build.
Per documentation:
When you request this page on client-side page transitions through next/link (documentation) or next/router (documentation), Next.js sends an API request to the server, which runs getServerSideProps. It’ll return JSON that contains the result of running getServerSideProps, and the JSON will be used to render the page. All this work will be handled automatically by Next.js, so you don’t need to do anything extra as long as you have getServerSideProps defined.
But the data is old one in that json file somehow