on-internet
← Community

React.lazy permanently caches a failed dynamic import — how can I retry a route chunk without reloading?

Stack Overflow ·

Every route in my SPA is code split with React.lazy. If a route's chunk fails to download because the device went offline, that route stays permanently broken for the lifetime of the document, and the "Retry" button in my error boundary cannot recover it. Environment React 19.2.5 react-router-dom (client-side routing) Vite (code splitting via dynamic import()) react-error-boundary ^4 Runs inside a hybrid WebView shell (Android WebView + iOS WKWebView) Observed in production on device, and reproduced locally against the dev server. Setup lazy() is called once per route at module scope: // src/a

Comments

Sign in or sign up to comment and upvote.

No comments yet.