Pages returning incorrect 404s

:wave: Hey folks,

Just received some rather angry emails from Google that URLs in my sitemap are returning 404s from Cloudflare Pages.

An example URL that is being returned as a 404 from Pages:

curl -I
HTTP/2 404

(Edit for clarification: This page will still work in a browser, as the 404 file in the project will handle doing client-side hydration (SPA-style) based on the current URL. However, this URL is being served from the 404 file rather than the correct pre-generated HTML file for the route, which can be seen if JS is disabled.)

I have run a build of the site locally, the exact same code as production, and have confirmed that the file for this page does exist:

npm run build
ls dist/lists/

The docs state that a file at that location should be accessible at the URL above, so I’m rather confused why I’m getting back 404s?

Based on the docs, it is also expected that accessing the direct HTML file will redirect to the non-HTML URL, which does appear to happen, so it definitely feels like something is going wrong with the non-HTML → HTML resolution:

curl -I
HTTP/2 308

Would appreciate some help, as Google is rather unhappy about the situation.

Greg took a look in the Cloudflare Developers Discord and confirmed this looks like a bug with how the URL is being resolved to an asset on Cf’s end, and has filed a bug as such.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.