Sounds like OP uses CF Pages. Curious if this happens for Vite apps on Vercel/Netlify at all?
I consider never having to worry about breaking resource links on deploy one of the killer features for client-rendered apps. Would be a shame to not be able to take advantage of that.
Push Safety with Vite
I ran into push safety issues with Vite: Every time when I deployed a new version, users on older clients would receive dynamic import() errors because Vite appends random ids to JS bundles, and when you deploy a new version without keeping the old ones on your CDN, those imports of files failed.
There is no good solution for this built into Vite because it is more of a deployment infra issue than a build infra concern. I would like to keep old bundles around, but I deploy 10 times a day and it's a hassle to keep every version around.
Instead, for now, I implemented my own wrapper around `React.lazy`: If an import fails, it will reload the page once. If it fails again, it will show an error message.
What do you think of this solution? What other options do I have?