Nuxt site deployed on Cloudflare Pages suddenly having issues loading?

My site hosted on Cloudflare pages is suddenly not loading properly. No changes have been made and the last deployment was nearly 30 days ago.
I set up pages rules today thinking redirects are the issue (wasn't using 301 for HTTP -> HTTPS or WWW -> non-WWW). So far it seems iffy if the propagation is loading properly. Once the browser caches, it seems to be okay? But the minute I test in another browser or on mobile I have a loading issue again. Once it finally loads, I get a 404 page. If I clear errors, I can then see the homepage again. The site in question: laborstaffers.com
2 Replies
kapa.ai
kapa.ai2w ago
Hi @MrBobDaisy. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the knowledge sources provided, I can identify several potential issues with your Nuxt site on Cloudflare Pages. The symptoms you're describing - 404 errors after deployment, partial loading, and issues that resolve after cache clearing - align with known issues when deploying Nuxt applications on Cloudflare. Here are some likely causes and solutions: 1. JS Chunk Loading Issues: After deployments, JS chunks can return 404 errors, causing the site to load partially and break functionality. This is a known issue with Nuxt deployments where old assets aren't properly cached or preserved. The default chunk error strategy reloads on user navigation, which might not fully resolve your issue GitHub Issue #31336. 2. Cloudflare Configuration: Several users have reported issues with Cloudflare's optimization settings interfering with Nuxt applications. The Auto Minify feature (which has been deprecated) and other Content/Image Optimization settings might be causing problems GitHub PR #29812. 3. Trailing Slash Issues: If your site has URLs without trailing slashes, this can cause 403 errors with Cloudflare. You might need to configure your router with trailingSlash: true and set up proper redirects Stack Overflow #77064938. 4. Compression Issues: There have been reports of the h3-compression dependency causing issues with Nuxt sites on Cloudflare, resulting in content being transformed unexpectedly Stack Overflow #78532075. Recommended solutions: 1. Check your Cloudflare settings and disable any Content Optimization features that might be interfering with your Nuxt application. 2. Ensure your Nuxt configuration has proper Cloudflare compatibility settings:
defineNuxtConfig({
nitro: {
cloudflare: {
nodeCompat: true,
deployConfig: true,
}
}
})
defineNuxtConfig({
nitro: {
cloudflare: {
nodeCompat: true,
deployConfig: true,
}
}
})
3. If you're using the latest Nuxt version, make sure you're also using the latest Nitro version (2.11.6+) which has fixed several Cloudflare-related issues GitHub Issue #31257. 4. Consider checking your dependencies for potential conflicts with Cloudflare, particularly compression-related packages. Since your site was working fine before and suddenly started having issues without code changes, it's likely that either Cloudflare made platform changes or cache configurations are causing the problem. Try purging the Cloudflare cache completely and testing again. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai2w ago
<@167473517812645889> Kapa.ai is still learning and improving, please let me know how I did by reacting below.

Did you find this page helpful?