Intermittent 404 Errors and Inconsistent Page Loads on Next.js App Hosted on Netlify

Hello Netlify Community,

I recently started experiencing (mid-day GMT 18th July) a critical issue with my Next.js application hosted on Netlify. The application shows intermittent 404 errors, slow page loads, and inconsistent functionality. These problems occur even though no recent changes to the application.

The 404 errors are as follows:

/_next/static/chunks/webpack-9550a8ccb8d52fdd.js:1 Failed to load resource: the server responded with a status of 404 ()
/_next/static/IZRV9RPWo82lSwelJQnuY/_buildManifest.js:1 Failed to load resource: the server responded with a status of 404 ()
/_next/static/chunks/9496-ad402dba953b6ca4.js:1 Failed to load resource: the server responded with a status of 404 ()
/_next/static/IZRV9RPWo82lSwelJQnuY/_ssgManifest.js:1 Failed to load resource: the server responded with a status of 404 ()
/_next/static/chunks/9001-a1f5baa10cb6159f.js:1 Failed to load resource: the server responded with a status of 404 ()

On some refreshes, when the page loads, the main content doesn’t appear and the errors mentioned above are logged in the console. Here is a screenshot:

On other refreshes, the application doesn’t seem to load JavaScript, resulting in enlarged icons and other misbehaviour (I can only include one screenshot so will try post image in the comments).

Weirdly, the page does load some of the time. However, even when the page loads, it’s significantly slower than usual. I also see these errors in my console log:

GET https://<myapp>/_next/static/IZRV9RPWo82lSwelJQnuY/_ssgManifest.js net::ERR_ABORTED 404
worldwide:41     GET https://<myapp>/_next/static/IZRV9RPWo82lSwelJQnuY/_buildManifest.js net::ERR_ABORTED 404

Additionally, I have noticed an apparent caching issue with the Netlify functions. The data returned by these functions varies slightly between requests, suggesting some problem with caching might be occurring.

Interestingly, some users in different parts of the world have reported no issues, making the problem harder to pinpoint and debug.

I’d greatly appreciate any assistance in diagnosing and resolving this issue, as it’s causing a significant disruption to my application’s operation…

Here is what the page looks like on refreshes where the javascript doesn’t load:

We are running into the same issues as described here, also since yesterday. Whenever a build update in Next.js causes a new js or css file hash, the old files are still requested once deployed and causing 404s with the site ending up in an unusable state. Running with cache cleared did not solve the issue.


File names according to build output:
CleanShot 2023-07-19 at 14.47.49
File names requested:

1 Like

After diving into the issue further, here are other things I noticed:

  • Similar to Aileen, the files our app is looking for do not match the names of the files built during deployment. If I download the deploy code and open the static/ directory, I see many files that do not match the names of the files my app is trying to look for.
  • There seems to be a caching issue on Netlify functions. I get different results each time I call my function (some results seem like stale values). The mind-boggling part is that the values change whenever I switch my VPN to a different location.
  • There is a delay/caching issue with cookies in Next.js’s server-side rendering code, a.k.a. getServerSideProps. I can see that a cookie is set in my web client, and then once I route to another page that expects that cookie, it is missing in getServerSideProps. Until yesterday, cookies always appeared immediately. The same happens when I remove a cookie. When I remove a cookie in the client and then route to a page that expects the cookie not to be there in getServerSideProps, the ghost cookie appears even though it no longer exists in the browser.
1 Like

When these issues started, I noticed that the Netlify build version changed from @netlify/build 29.16.0 to @netlify/build 29.16.3. That could potentially be the culprit; looking into it further!

Just started running into these issues with a Nextjs app on the 18th as well.

@vjohnston and @AileenCGN, we’re discussing this with both of you in your individual tickets. At least in case of @vjohnston this was a case of manually overriding cache control headers, and I’ve asked @AileenCGN, if they’ve done the same.

@adamqq, if you’re having issues, please share a site to check.

I am getting similar errors

/_next/static/uV-7FC_fMQgYD02_ud2wW/_buildManifest.js net::ERR_ABORTED 404
/_next/static/uV-7FC_fMQgYD02_ud2wW/_ssgManifest.js net::ERR_ABORTED 404

@chiaberry, this hardly seems related. Please open a new thread with some useful details.