Code Monkey home page Code Monkey logo

Comments (3)

robincarlo84 avatar robincarlo84 commented on May 12, 2024

I have the same issue but on getStaticProps. It happens when you keep a page open and do a rebuild, and right after the rebuild you go to the page again, and click any internal links then you'll see their responses are empty.

So I checked an older Nextjs version(13.4.8) to see how it was working before.

Before, when you click any internal links after a rebuild, the JSON files will return 404 then sends you to the actual page.
image_2024_02_28T18_41_38_663Z

Now using the latest version(14.1.0), when you click any internal links after a rebuild, the JSON files will return 200 but wont send you to the actual page.
image_2024_02_28T18_50_32_977Z

It's probably a caching issue, the page doesn't seem to realize that the JSON URL doesn't exist anymore.

from next.js.

Bahlaouane-Hamza avatar Bahlaouane-Hamza commented on May 12, 2024

I believe it's a cache issue.
Next base server returns res.body("{}").send(); when there no content change.
Just to confirm, after you get that empty object, open the json link in a new tab and force page reload, do you see the content again ? If so, you need to force a res.setHeader('Cache-Control', 'no-store');

Another question, are you using any service workers ? pwa stuff ?

from next.js.

rajtersimon avatar rajtersimon commented on May 12, 2024

It's an issue if you are using the middleware with the pages directory. More can be found here: #57207, #59612. It was fixed in v14.1.1-canary.37, but was not included in the v14.1.1 release 🤷‍♂️

The latest stable release that does not have this issue is v13.4.12

from next.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.