Member-only story
Why Deploying a New React App Can Break Users Who Never Refreshed
Bestte
9 min read5 hours ago
The deployment succeeds, the new version works, but an old browser tab can still be running code from yesterday.
Press enter or click to view image in full size
Imagine you’ve deployed a new version of your React application. Everything looks fine. The build passed, the deployment completed, and when you open the website, the latest version is there.
Then someone tells you that a page isn’t working.
You open the same page. It works.
They refresh their browser, and suddenly it works for them too.
So what exactly happened?
I wanted to understand this situation a little better, especially because it seems strange that deploying a working version of an application could break something that was already running.
I put together a small JavaScript example to reproduce one possible explanation.
It has to do with how modern frontend applications load their JavaScript files.…