Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix(error-handler): auto-reload em chunk load errors após deploy (stale chunks) #600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
fix(error-handler): auto-reload em chunk load errors após deploy (stale chunks) #600
Changes from all commits
9a713d1File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In production, ordinary application
TypeErrors also have stack frames pointing at bundled files under/assets/*.js, so this fallback will classify many real runtime bugs (for example a null dereference inside a lazy page) as stale chunk failures. Those errors then skip the normal global error logging/toast path and trigger an automatic reload, masking the original bug and disrupting users even when no deploy-stale chunk is involved.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When this catch path is hit (for example in a sandboxed frame or a browser/privacy mode that denies
sessionStoragewrites), the reload attempt is never persisted;getReloadAttempts()will keep returning0, so any persistent chunk failure is treated as a first attempt and schedules another automatic reload. That defeats the loop protection this handler is meant to provide and can trap affected users in a reload loop instead of showing the manual hard-refresh message.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this timer clears the guard merely 5 seconds after the shell boots, a deploy with a broken lazy route that is not requested during those first 5 seconds will lose the previous auto-reload count. If the user later navigates to that route, the same persistent chunk error is treated as a fresh first attempt and auto-reloads again instead of stopping after one session attempt, so the advertised broken-deploy fallback can still loop on delayed route access.
Useful? React with 👍 / 👎.
Uh oh!
There was an error while loading. Please reload this page.