Skip to content

fix: clear errors while the overlay is loading - #1057

Open
OskarEichler wants to merge 1 commit into
pmmmwh:mainfrom
OskarEichler:codex/react-refresh-overlay-pending-clear
Open

fix: clear errors while the overlay is loading#1057
OskarEichler wants to merge 1 commit into
pmmmwh:mainfrom
OskarEichler:codex/react-refresh-overlay-pending-clear

Conversation

@OskarEichler

Copy link
Copy Markdown

Fix

Make compile/runtime error clearing effective while the overlay iframe is still loading.

Today both clear methods return when the iframe root is not ready. The pending load then renders an error that was already cleared. Runtime errors have a second path to the same result: the debounced callback retains the old error array and can recreate the overlay after clearing.

Implementation

  • Reset pending error state before the iframe root exists and remove the pending iframe when no other error needs it.
  • Ignore late load events from an iframe that has already been cleaned up.
  • Read current runtime errors when the debounce fires instead of retaining a stale array.
  • Reset the cached iframe document during cleanup.

Verification

  • Added three regressions for pending compile clearing, pending runtime clearing, and clearing during the runtime-error debounce. All fail on current main and pass with this fix.
  • Full suite including headless Chrome HMR conformance: 125 tests across 15 suites, 26 snapshots passed.
  • ESLint, Prettier, TypeScript, and whitespace checks passed.
  • React Doctor: 100/100.

Compatibility / breaking changes

No public API, dependency, socket integration, or supported-platform changes. Clearing errors now prevents an already-cleared pending overlay from appearing.

@codesandbox

codesandbox Bot commented Aug 31, 2026

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant