◉RORK LABJP
●GPT-6.1 SOL — Added to Rork's model menu (09-29) with Low, Medium and High effort; included on Pro and Max●SONNET 5.5 — Claude Sonnet 5.5 is selectable: strong at UI design and faster than Sonnet 5 (09-28)●SDK 58 — Expo SDK 58 is out of beta as of 10/15 (beta since 09/15). Check your dependencies before upgrading●SDK 58 ISSUE — Early reports include Android widgets not refreshing on a schedule and Stripe linking statically●OBSERVE — EAS Observe now records native crashes too (SDK 57.0.21 or later, 10/07)●NEW — My App Open Ad Only Showed When the App…●GPT-6.1 SOL — Added to Rork's model menu (09-29) with Low, Medium and High effort; included on Pro and Max●SONNET 5.5 — Claude Sonnet 5.5 is selectable: strong at UI design and faster than Sonnet 5 (09-28)●SDK 58 — Expo SDK 58 is out of beta as of 10/15 (beta since 09/15). Check your dependencies before upgrading●SDK 58 ISSUE — Early reports include Android widgets not refreshing on a schedule and Stripe linking statically●OBSERVE — EAS Observe now records native crashes too (SDK 57.0.21 or later, 10/07)●NEW — My App Open Ad Only Showed When the App…
Articles/Dev Tools
⬡ Dev Tools/2026-10-20Advanced

Why Redeploying Doesn't Fix the Application Error You See Right After a Deploy

Right after I swapped a secret, every page showed Application error. Stale HTML was calling a JS file that no longer existed. Here are a detection script, a build-version check for the edge cache, and a once-only auto-reload, all run and verified.

Cloudflare Workers26Next.js3deploymentcaching3ChunkLoadError

✦ Premium Article

It was the day I swapped a single environment variable and waited for the deploy to finish. When I opened the site to check, the screen was white, with just "Application error: a client-side exception has occurred."

The article pages failed, and so did the home page. The server logs were quiet and the build had succeeded. So I deployed again. It still did not recover.

A redeploy renews the server, but it does not renew the HTML that has already been handed out. This post records the detour I took before noticing that obvious fact, and the line I drew afterward. As an indie developer running a Next.js site on Cloudflare Workers, I wrote it so that anyone in the same spot can get through that evening faster, with steps and code I actually ran.

Two red lines in the console

Opening the browser's developer tools, I found two red lines: __name is not defined and ChunkLoadError.

The first looks like a bug in my own code. But the network tab showed one JS file returning 404, and the body of that 404 was HTML. The browser tried to treat it as JavaScript, and everything after it stopped in a chain.

Every page failed because, I believe, that chunk belonged to a shared part of the app. Only one file was missing, yet the whole screen stopped. The first thing to look at was not the code but the name of the file returning 404.

What was happening: old HTML meets new chunks

Every build puts a hash in the JS file names, and a new build does not ship the files with old hashes. Anyone who still holds old HTML, in the browser or at the edge, is told to fetch the old names.

What is heldFile it callsIn the new build's assets
HTML generated before the deployChunk with the old hashMissing. It returns 404
HTML generated after the deployChunk with the new hashPresent. It loads normally

So the problem is not inside the new build. Old HTML is still being served ahead of the new build. Changing an environment variable or a secret redeploys the Worker with a new build ID, and right after that the mismatch is especially easy to hit.

If only the browser holds the old HTML, a hard reload fixes it, and on some days that was enough. On other days it was not.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦When an Application error appears right after a deploy, you can decide which layer to suspect first instead of redeploying again and again
✦Right after a deploy finishes, you can verify with one script that every JS file your HTML references really exists
✦You can stop old edge-cached HTML from being served ahead of the new build with a few dozen lines added to your own Worker
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

⬡ Dev Tools2026-05-09
Building a Rork A/B Testing Platform with GrowthBook and PostHog from Scratch
Drop Firebase and pair GrowthBook with PostHog to ship a production-grade A/B testing stack for your Rork apps. SDK wiring, edge evaluation on Cloudflare Workers, Bayesian statistics interpretation, and the operational pitfalls I learned the hard way.
⬡ Dev Tools2026-05-03
Sign in with Apple in Rork: Server-Side Verification, Account Linking, and the Mandatory Deletion Flow
A Sign in with Apple button that only lives on the client tends to fray on the server before it ever fails review. This guide builds the rest on Cloudflare Workers: a server-issued nonce, ID token verification, prompt authorizationCode exchange, an account deletion flow that revokes properly, and Apple's server-to-server notifications.
⬡ Dev Tools2026-04-30
Rork × AI Moderation Production Guide: Reporting, Auto-Review, and Tiered Sanctions for UGC Apps
A complete production-grade guide to layering AI moderation, reporting, and tiered sanctions into your Rork UGC app. Includes a working three-layer pipeline using OpenAI Moderation, Perspective API, and Cloudflare Workers Queues.