[{"data":1,"prerenderedAt":500},["ShallowReactive",2],{"navigation":3,"/blog/postmortem-nuxt-cloudflare-chunk-error":142,"surround-postmortem-nuxt-cloudflare-chunk-error":489},[4],{"title":5,"path":6,"stem":7,"children":8,"page":141},"Blog","/blog","blog",[9,13,17,21,25,29,33,37,41,45,49,53,57,61,65,69,73,77,81,85,89,93,97,101,105,109,113,117,121,125,129,133,137],{"title":10,"path":11,"stem":12},"How to Increase Free Tier Memory on AWS EC2","/blog/aws-ec2-ram","blog/aws-ec2-ram",{"title":14,"path":15,"stem":16},"Blooper: The Disappearing Cloudflare Variables","/blog/blooper-cloudflare-env-vars","blog/blooper-cloudflare-env-vars",{"title":18,"path":19,"stem":20},"Blooper: Hardcoded Content Links cause 404s","/blog/blooper-hardcoded-nuxt-content-links","blog/blooper-hardcoded-nuxt-content-links",{"title":22,"path":23,"stem":24},"Blooper: The Invisible SEO","/blog/blooper-nuxt-seo-env","blog/blooper-nuxt-seo-env",{"title":26,"path":27,"stem":28},"Blooper: The SSR Crash of Doom","/blog/blooper-ssr-feedback-form","blog/blooper-ssr-feedback-form",{"title":30,"path":31,"stem":32},"Blooper: The YouTube Crawl Budget Killer","/blog/blooper-video-crawl-budget","blog/blooper-video-crawl-budget",{"title":34,"path":35,"stem":36},"Blooper: PWA Redirecting SPA Routes","/blog/blooper-vite-pwa-ssr-redirects","blog/blooper-vite-pwa-ssr-redirects",{"title":38,"path":39,"stem":40},"The Developer's Guide to Avoiding Cloud Billing Traps in 2026","/blog/cloud-billing-traps-2026","blog/cloud-billing-traps-2026",{"title":42,"path":43,"stem":44},"Disk Management in Linux","/blog/disk-management-in-linux","blog/disk-management-in-linux",{"title":46,"path":47,"stem":48},"Docker Devtools Stage | Powerlevel, OhMyZSH, tmux, fuzzy finder, autocomplete etc","/blog/docker-devtools","blog/docker-devtools",{"title":50,"path":51,"stem":52},"Docker container | Resolving Permission Denied Woes: A Decade-Long Struggle Unraveled","/blog/docker-non-root-user-perms","blog/docker-non-root-user-perms",{"title":54,"path":55,"stem":56},"The Ultimate Guide to Free Tier Hosting Platforms (Serverless & Containers)","/blog/free-hosting-platforms-guide","blog/free-hosting-platforms-guide",{"title":58,"path":59,"stem":60},"Git commands | underrated","/blog/git-commands-underrated","blog/git-commands-underrated",{"title":62,"path":63,"stem":64},"Journey: Taming Edge Caching and KV Storage","/blog/journey-github-streak-caching","blog/journey-github-streak-caching",{"title":66,"path":67,"stem":68},"Kubernetes Cluster Setup Guide","/blog/k8s-setup","blog/k8s-setup",{"title":70,"path":71,"stem":72},"Linux WiFi Drivers","/blog/linux-wifi-drivers","blog/linux-wifi-drivers",{"title":74,"path":75,"stem":76},"pfSense basic firewall setup","/blog/pfsense-basic-firewall-setup","blog/pfsense-basic-firewall-setup",{"title":78,"path":79,"stem":80},"pfSense Quickstart","/blog/pfsense-quickstart","blog/pfsense-quickstart",{"title":82,"path":83,"stem":84},"Postmortem: Cloudflare Worker Missing Dependency on Deploy","/blog/postmortem-cloudflare-worker-dependency-deploy","blog/postmortem-cloudflare-worker-dependency-deploy",{"title":86,"path":87,"stem":88},"Postmortem: Serverless HTTP Driver Transaction Failures","/blog/postmortem-neon-http-transactions","blog/postmortem-neon-http-transactions",{"title":90,"path":91,"stem":92},"Postmortem: The Ghost in the Chrome Cache (Nuxt & Cloudflare Pages)","/blog/postmortem-nuxt-cloudflare-chunk-error","blog/postmortem-nuxt-cloudflare-chunk-error",{"title":94,"path":95,"stem":96},"Postmortem: Nuxt Content 404s on Staging Deployments","/blog/postmortem-nuxt-content-404-staging","blog/postmortem-nuxt-content-404-staging",{"title":98,"path":99,"stem":100},"Postmortem: 500 Internal Server Error on ISR Routes","/blog/postmortem-nuxt-content-payload-extraction","blog/postmortem-nuxt-content-payload-extraction",{"title":102,"path":103,"stem":104},"Post-Mortem: Intrusive Database Driver Refactoring","/blog/postmortem-proxy-re-architecting","blog/postmortem-proxy-re-architecting",{"title":106,"path":107,"stem":108},"Post-Mortem: Cloudflare Worker Connection Hang & Resilient DB Fallbacks","/blog/postmortem-worker-db-connection-hang","blog/postmortem-worker-db-connection-hang",{"title":110,"path":111,"stem":112},"Pro Tip: Sandboxing Cloudflare Workers for AI Agents","/blog/pro-tip-wrangler-local-dev-trick","blog/pro-tip-wrangler-local-dev-trick",{"title":114,"path":115,"stem":116},"Proxmox DNS Management","/blog/proxmox-dns","blog/proxmox-dns",{"title":118,"path":119,"stem":120},"Proxmox Recovery","/blog/proxmox-recovery","blog/proxmox-recovery",{"title":122,"path":123,"stem":124},"Proxmox WiFi Connection Story","/blog/proxmox-wifi","blog/proxmox-wifi",{"title":126,"path":127,"stem":128},"roadauth-rails api jwt cors","/blog/rodauth-jwt","blog/rodauth-jwt",{"title":130,"path":131,"stem":132},"SOCKS5 Proxy Quickstart","/blog/sock5-proxy","blog/sock5-proxy",{"title":134,"path":135,"stem":136},"tmux status bar toggle","/blog/tmux-status","blog/tmux-status",{"title":138,"path":139,"stem":140},"UFW - Cheatsheet","/blog/ufw-cheatsheet","blog/ufw-cheatsheet",false,{"id":143,"title":90,"authors":144,"badge":150,"body":152,"date":477,"description":478,"extension":479,"image":480,"imageComponent":481,"meta":483,"navigation":484,"path":91,"pinned":141,"seo":485,"seoImage":486,"stem":92,"__hash__":488},"posts/blog/postmortem-nuxt-cloudflare-chunk-error.md",[145],{"name":146,"to":147,"avatar":148},"Rahul Dhole","/",{"src":149},"/profile.png",{"label":151},"Postmortem",{"type":153,"value":154,"toc":467},"minimark",[155,160,169,172,182,185,199,205,213,216,220,223,245,256,261,268,289,296,307,316,333,335,339,342,346,352,363,367,370,377,453,463],[156,157,159],"h2",{"id":158},"the-incident","The Incident",[161,162,163,164,168],"p",{},"It was supposed to be a routine deployment. I wrote a new blog post, pushed it to ",[165,166,167],"code",{},"main",", and watched Cloudflare Pages build and deploy the Nuxt 3 site successfully. Everything looked green.",[161,170,171],{},"Then, I opened the site in Chrome, clicked a link, and the page crashed with this infamous error:",[173,174,180],"pre",{"className":175,"code":177,"language":178,"meta":179},[176],"language-text","[nuxt] error caught during app initialization\nTypeError: Failed to fetch dynamically imported module: https://rahuldhole.com/_nuxt/Dg6KwZeV.js\n","text","",[165,181,177],{"__ignoreMap":179},[161,183,184],{},"\"No problem,\" I thought. \"Just a stale chunk. I'll do a hard reload.\"",[161,186,187,188,191,192,196,197],{},"I hit ",[165,189,190],{},"Cmd+Shift+R",". ",[193,194,195],"strong",{},"It still crashed.","\nI opened an Incognito window. ",[193,198,195],{},[161,200,201,202],{},"Then, out of sheer desperation, I opened the site in Firefox. ",[193,203,204],{},"It worked perfectly.",[161,206,207,208,212],{},"Why would a missing JavaScript chunk error happen ",[209,210,211],"em",{},"only"," in Chrome, survive a hard reload, and persist even in Incognito mode?",[214,215],"hr",{},[156,217,219],{"id":218},"the-investigation","The Investigation",[161,221,222],{},"Initially, my thoughts went to the usual suspects:",[224,225,226,233,239],"ol",{},[227,228,229,232],"li",{},[193,230,231],{},"A rogue Service Worker?"," I didn't have one installed.",[227,234,235,238],{},[193,236,237],{},"A corrupted Nuxt build?"," A local build verified everything was compiling perfectly.",[227,240,241,244],{},[193,242,243],{},"A Chrome extension?"," Incognito mode ruled that out.",[161,246,247,248,251,252,255],{},"The fact that Firefox was getting the fresh files while Chrome was getting an old ",[165,249,250],{},"index.html"," (which was asking for a deleted ",[165,253,254],{},".js"," chunk) meant this had to be an edge caching issue. But why was Cloudflare treating Chrome differently than Firefox?",[257,258,260],"h3",{"id":259},"the-culprit-accept-encoding","The Culprit: Accept-Encoding",[161,262,263,264,267],{},"The breakthrough came when looking at how modern browsers request files, specifically the ",[165,265,266],{},"Accept-Encoding"," header.",[269,270,271,280],"ul",{},[227,272,273,276,277],{},[193,274,275],{},"Chrome"," (and most Chromium browsers) asks for: ",[165,278,279],{},"gzip, deflate, br, zstd",[227,281,282,285,286],{},[193,283,284],{},"Firefox"," asks for: ",[165,287,288],{},"gzip, deflate, br",[161,290,291,292,295],{},"Cloudflare is smart. Too smart, sometimes. It caches responses ",[209,293,294],{},"separately"," based on the compression format.",[161,297,298,299,302,303,306],{},"When my deployment finished, Cloudflare automatically purged its edge cache. However, due to an eventual consistency hiccup on the edge node nearest to me, the ",[165,300,301],{},"br"," (Brotli) cache key was successfully purged, while the ",[165,304,305],{},"zstd"," (Zstandard) cache key got stuck.",[161,308,309,310,312,313,315],{},"So when Firefox visited the site, Cloudflare saw a cache miss for ",[165,311,301],{},", fetched the fresh ",[165,314,250],{}," from the origin, and loaded the site perfectly.",[161,317,318,319,321,322,325,326,328,329,332],{},"But when Chrome visited the site, Cloudflare saw a cache hit for ",[165,320,305],{},", and happily served up the ",[209,323,324],{},"old"," ",[165,327,250],{}," from before the deployment. That old HTML file told Chrome to download ",[165,330,331],{},"Dg6KwZeV.js","—a file that had already been deleted from the server. Boom. Crash.",[214,334],{},[156,336,338],{"id":337},"the-solution","The Solution",[161,340,341],{},"There are two steps to fixing this and ensuring it never impacts users again.",[257,343,345],{"id":344},"_1-the-immediate-fix-purge-everything","1. The Immediate Fix: Purge Everything",[161,347,348,349,351],{},"A hard reload in your browser doesn't change the ",[165,350,266],{}," header, so you just keep hitting the same stuck cache key on the edge node.",[161,353,354,355,358,359,362],{},"The only way to forcefully break the cycle is to log into the Cloudflare Dashboard, go to ",[193,356,357],{},"Caching > Configuration",", and hit ",[193,360,361],{},"\"Purge Everything\"",". Within 60 seconds, Chrome was back to normal.",[257,364,366],{"id":365},"_2-the-long-term-fix-nuxts-built-in-safety-net","2. The Long-Term Fix: Nuxt's Built-in Safety Net",[161,368,369],{},"You can't expect your users to purge your Cloudflare cache for you. Thankfully, the Nuxt team is well aware of these SPA chunk loading errors and built a native safeguard directly into the framework.",[161,371,372,373,376],{},"By adding this to your ",[165,374,375],{},"nuxt.config.ts",":",[173,378,382],{"className":379,"code":380,"language":381,"meta":179,"style":179},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","export default defineNuxtConfig({\n  experimental: {\n    emitRouteChunkError: 'automatic'\n  }\n})\n","typescript",[165,383,384,408,420,438,444],{"__ignoreMap":179},[385,386,389,393,396,400,404],"span",{"class":387,"line":388},"line",1,[385,390,392],{"class":391},"s7zQu","export",[385,394,395],{"class":391}," default",[385,397,399],{"class":398},"s2Zo4"," defineNuxtConfig",[385,401,403],{"class":402},"sTEyZ","(",[385,405,407],{"class":406},"sMK4o","{\n",[385,409,411,415,417],{"class":387,"line":410},2,[385,412,414],{"class":413},"swJcz","  experimental",[385,416,376],{"class":406},[385,418,419],{"class":406}," {\n",[385,421,423,426,428,431,435],{"class":387,"line":422},3,[385,424,425],{"class":413},"    emitRouteChunkError",[385,427,376],{"class":406},[385,429,430],{"class":406}," '",[385,432,434],{"class":433},"sfazB","automatic",[385,436,437],{"class":406},"'\n",[385,439,441],{"class":387,"line":440},4,[385,442,443],{"class":406},"  }\n",[385,445,447,450],{"class":387,"line":446},5,[385,448,449],{"class":406},"}",[385,451,452],{"class":402},")\n",[161,454,455,456,459,460,462],{},"Nuxt will intercept that ",[165,457,458],{},"Failed to fetch dynamically imported module"," error. Instead of throwing a fatal crash, it will automatically force a hard reload of the window, seamlessly fetching the fresh ",[165,461,250],{}," and the correct chunks. Your users get the new site, and nobody even notices the deployment happened!",[464,465,466],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":179,"searchDepth":410,"depth":410,"links":468},[469,470,473],{"id":158,"depth":410,"text":159},{"id":218,"depth":410,"text":219,"children":471},[472],{"id":259,"depth":422,"text":260},{"id":337,"depth":410,"text":338,"children":474},[475,476],{"id":344,"depth":422,"text":345},{"id":365,"depth":422,"text":366},"2026-08-06","How a routine Nuxt deployment led to a bizarre, Chrome-only \"Failed to fetch dynamically imported module\" crash—and the obscure Cloudflare caching quirk behind it.","md",null,{"title":482,"subtitle":458,"type":151},"INCIDENT: Chunk Load Error",{},true,{"title":90,"description":478},{"src":487},"https://placehold.co/800x400/ef4444/ffffff?text=Nuxt+Chunk+Error+Postmortem","GycffuOqrn3mCbu9lSkwbDooT1oIa8ahcVvial9ZNX8",[490,495],{"title":86,"path":87,"stem":88,"description":491,"imageComponent":492,"seoImage":493,"children":-1},"Why database transactions fail in serverless HTTP drivers and how to architect around them using compensating transactions.",{"type":151},{"src":494},"https://placehold.co/800x400/0f172a/3b82f6?text=Serverless+HTTP+Transactions",{"title":94,"path":95,"stem":96,"description":496,"imageComponent":497,"seoImage":498,"children":-1},"Debugging missing content and 404 errors when deploying Nuxt Content to Cloudflare D1.",{"type":151},{"src":499},"https://placehold.co/800x400/0f172a/3b82f6?text=Nuxt+Content+404s",1787398226701]