[{"data":1,"prerenderedAt":310},["ShallowReactive",2],{"navigation":3,"/blog/blooper-vite-pwa-ssr-redirects":154,"surround-blooper-vite-pwa-ssr-redirects":298},[4],{"title":5,"path":6,"stem":7,"children":8,"page":153},"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,141,145,149],{"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},"Git Branching in 2026: Code State, Environment Isolation, and Modern CD","/blog/branch-theater-staging-branches","blog/branch-theater-staging-branches",{"title":42,"path":43,"stem":44},"The Developer's Guide to Avoiding Cloud Billing Traps in 2026","/blog/cloud-billing-traps-2026","blog/cloud-billing-traps-2026",{"title":46,"path":47,"stem":48},"Disk Management in Linux","/blog/disk-management-in-linux","blog/disk-management-in-linux",{"title":50,"path":51,"stem":52},"Docker Devtools Stage | Powerlevel, OhMyZSH, tmux, fuzzy finder, autocomplete etc","/blog/docker-devtools","blog/docker-devtools",{"title":54,"path":55,"stem":56},"Docker container | Resolving Permission Denied Woes: A Decade-Long Struggle Unraveled","/blog/docker-non-root-user-perms","blog/docker-non-root-user-perms",{"title":58,"path":59,"stem":60},"The Ultimate Guide to Free Tier Hosting Platforms (Serverless & Containers)","/blog/free-hosting-platforms-guide","blog/free-hosting-platforms-guide",{"title":62,"path":63,"stem":64},"Git commands | underrated","/blog/git-commands-underrated","blog/git-commands-underrated",{"title":66,"path":67,"stem":68},"Journey: Taming Edge Caching and KV Storage","/blog/journey-github-streak-caching","blog/journey-github-streak-caching",{"title":70,"path":71,"stem":72},"Kubernetes Cluster Setup Guide","/blog/k8s-setup","blog/k8s-setup",{"title":74,"path":75,"stem":76},"Linux WiFi Drivers","/blog/linux-wifi-drivers","blog/linux-wifi-drivers",{"title":78,"path":79,"stem":80},"4 Common Routing Traps When Migrating to Nuxt i18n","/blog/nuxt-i18n-routing","blog/nuxt-i18n-routing",{"title":82,"path":83,"stem":84},"Patch the CVE, Don't Trigger an Accidental Refactor: Surviving PHP2Shell on Docker","/blog/patching-php2shell-docker-playbook","blog/patching-php2shell-docker-playbook",{"title":86,"path":87,"stem":88},"pfSense basic firewall setup","/blog/pfsense-basic-firewall-setup","blog/pfsense-basic-firewall-setup",{"title":90,"path":91,"stem":92},"pfSense Quickstart","/blog/pfsense-quickstart","blog/pfsense-quickstart",{"title":94,"path":95,"stem":96},"Postmortem: Cloudflare Worker Missing Dependency on Deploy","/blog/postmortem-cloudflare-worker-dependency-deploy","blog/postmortem-cloudflare-worker-dependency-deploy",{"title":98,"path":99,"stem":100},"Postmortem: Serverless HTTP Driver Transaction Failures","/blog/postmortem-neon-http-transactions","blog/postmortem-neon-http-transactions",{"title":102,"path":103,"stem":104},"Postmortem: The Ghost in the Chrome Cache (Nuxt & Cloudflare Pages)","/blog/postmortem-nuxt-cloudflare-chunk-error","blog/postmortem-nuxt-cloudflare-chunk-error",{"title":106,"path":107,"stem":108},"Postmortem: Nuxt Content 404s on Staging Deployments","/blog/postmortem-nuxt-content-404-staging","blog/postmortem-nuxt-content-404-staging",{"title":110,"path":111,"stem":112},"Postmortem: 500 Internal Server Error on ISR Routes","/blog/postmortem-nuxt-content-payload-extraction","blog/postmortem-nuxt-content-payload-extraction",{"title":114,"path":115,"stem":116},"Post-Mortem: Intrusive Database Driver Refactoring","/blog/postmortem-proxy-re-architecting","blog/postmortem-proxy-re-architecting",{"title":118,"path":119,"stem":120},"Post-Mortem: Cloudflare Worker Connection Hang & Resilient DB Fallbacks","/blog/postmortem-worker-db-connection-hang","blog/postmortem-worker-db-connection-hang",{"title":122,"path":123,"stem":124},"Pro Tip: Sandboxing Cloudflare Workers for AI Agents","/blog/pro-tip-wrangler-local-dev-trick","blog/pro-tip-wrangler-local-dev-trick",{"title":126,"path":127,"stem":128},"Proxmox DNS Management","/blog/proxmox-dns","blog/proxmox-dns",{"title":130,"path":131,"stem":132},"Proxmox Recovery","/blog/proxmox-recovery","blog/proxmox-recovery",{"title":134,"path":135,"stem":136},"Proxmox WiFi Connection Story","/blog/proxmox-wifi","blog/proxmox-wifi",{"title":138,"path":139,"stem":140},"roadauth-rails api jwt cors","/blog/rodauth-jwt","blog/rodauth-jwt",{"title":142,"path":143,"stem":144},"SOCKS5 Proxy Quickstart","/blog/sock5-proxy","blog/sock5-proxy",{"title":146,"path":147,"stem":148},"tmux status bar toggle","/blog/tmux-status","blog/tmux-status",{"title":150,"path":151,"stem":152},"UFW - Cheatsheet","/blog/ufw-cheatsheet","blog/ufw-cheatsheet",false,{"id":155,"title":34,"authors":156,"badge":162,"body":164,"date":287,"description":288,"extension":289,"image":290,"imageComponent":291,"meta":292,"navigation":293,"path":35,"pinned":153,"seo":294,"seoImage":295,"stem":36,"__hash__":297},"posts/blog/blooper-vite-pwa-ssr-redirects.md",[157],{"name":158,"to":159,"avatar":160},"Rahul Dhole","/",{"src":161},"/profile.png",{"label":163},"Blooper",{"type":165,"value":166,"toc":281},"minimark",[167,172,188,192,207,221,225,228,274,277],[168,169,171],"h2",{"id":170},"issue","Issue",[173,174,175,176,180,181,184,185,187],"p",{},"Reloading SPA pages (like a ",[177,178,179],"code",{},"/dashboard"," or ",[177,182,183],{},"/profile"," route) in production unexpectedly redirected the user back to the home page ",[177,186,159],{},". Local development worked perfectly fine without any redirects.",[168,189,191],{"id":190},"root-cause","Root Cause",[173,193,194,195,197,198,200,201,206],{},"Vite PWA intercepted the navigation requests in production and fell back to serving the cached ",[177,196,159],{}," HTML. Since the framework hydrated with the root page's state on a different URL, the router detected a state mismatch and forcefully redirected the user back to ",[177,199,159],{}," (",[202,203,205],"a",{"href":204},"#fig-1","Figure 1",").",[173,208,209,212,217],{},[202,210],{"id":211},"fig-1",[213,214],"mermaid",{":config":215,"code":216},"config","flowchart%20TD%0A%20%20%20%20A%5BUser%20visits%20%2Fdashboard%5D%20--%3E%20B(PWA%20Service%20Worker%20intercepts)%0A%20%20%20%20B%20--%3E%20C%7BHas%20%2Fdashboard%20cache%3F%7D%0A%20%20%20%20C%20--%20No%20--%3E%20D%5BPWA%20Fallback%20to%20%2F%20HTML%5D%0A%20%20%20%20D%20--%3E%20E%5BClient%20hydrates%20with%20%2F%20state%5D%0A%20%20%20%20E%20--%3E%20F%5BRouter%20detects%20URL%20mismatch%5D%0A%20%20%20%20F%20--%3E%20G%5BForce%20Redirect%20to%20%2F%5D%0A%20%20%20%20G%20--%3E%20H((User%20confused))",[218,219,220],"em",{},"Figure 1: PWA navigation fallback redirect loop",[168,222,224],{"id":223},"resolution","Resolution",[173,226,227],{},"Disabled the PWA navigation fallback in the configuration:",[229,230,235],"pre",{"className":231,"code":232,"language":233,"meta":234,"style":234},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pwa: { workbox: { navigateFallback: null } }\n","ts","",[177,236,237],{"__ignoreMap":234},[238,239,242,246,250,253,256,258,260,263,265,268,271],"span",{"class":240,"line":241},"line",1,[238,243,245],{"class":244},"sBMFI","pwa",[238,247,249],{"class":248},"sMK4o",":",[238,251,252],{"class":248}," {",[238,254,255],{"class":244}," workbox",[238,257,249],{"class":248},[238,259,252],{"class":248},[238,261,262],{"class":244}," navigateFallback",[238,264,249],{"class":248},[238,266,267],{"class":248}," null",[238,269,270],{"class":248}," }",[238,272,273],{"class":248}," }\n",[173,275,276],{},"This lets the server environment handle navigations naturally and generate SPA shells for client-side only routes.",[278,279,280],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}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":234,"searchDepth":282,"depth":282,"links":283},2,[284,285,286],{"id":170,"depth":282,"text":171},{"id":190,"depth":282,"text":191},{"id":223,"depth":282,"text":224},"2026-06-23","How Vite PWA intercepted navigation requests in production and caused redirect loops.","md",null,{"type":163},{},true,{"title":34,"description":288},{"src":296},"https://placehold.co/800x400/0f172a/3b82f6?text=PWA+Redirecting+SPA+Routes","wsf7n3VcShZgOAbbmvN5WkyuefWVFl8mYTS51167_bU",[299,304],{"title":30,"path":31,"stem":32,"description":300,"imageComponent":301,"seoImage":302,"children":-1},"How server-rendered YouTube iframes destroyed our SEO crawl budget.",{"type":163},{"src":303},"https://placehold.co/800x400/0f172a/3b82f6?text=Crawl+Budget+Killer",{"title":38,"path":39,"stem":40,"description":305,"imageComponent":306,"seoImage":308,"children":-1},"Exploring why using Git branches as proxies for deployment environments fails modern CI/CD, how persistent state and build artifacts play into it, and two practical alternatives.",{"type":307},"Git",{"src":309},"https://placehold.co/800x400/0f172a/3b82f6?text=Git+Branching+2026",1792753000255]