Tengo un archivo pages/index.tsx
en mi proyecto NextJS que tiene getServerSideProps
Cuando actualizo la página, muestra los datos correctos en la página.
Cuando trato de navegar desde la página de "inicio de sesión" a index.tsx
, intenta obtener datos de some_url/_next/data/some_weird_hash/index.json
, pero son datos incorrectos del usuario anterior que inició sesión.
¿Agradecemos alguna idea o sugerencia?
Localmente funciona bien, este problema solo aparece en la compilación.
Por documentación:
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.
Pero los datos son antiguos en ese archivo json de alguna manera