• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

187
Views
getServerSideProps está obteniendo datos incorrectos en el cambio de ruta

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

almost 3 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error