Show dev overlay errors before the indicator state is known (#100629)
## Summary In development, the dev overlay renders nothing until the HMR `sync` message arrives. That message tells the client whether the dev indicator is disabled, and the client waits for it so a disabled indicator doesn't briefly appear. The error overlay (redbox) sat behind the same check, though. If `sync` was delayed or lost, compile and runtime errors already reached the client state but no redbox was shown. This PR keeps the indicator-readiness check only for the indicator UI, meaning the devtools indicator and its panels. The error overlay and the contexts it needs now render independently of it, so errors show as soon as they are known. When `sync` arrives normally, the indicator behaves the same as before. #100628 removes the server-side cause of a delayed `sync` (waiting on the npm registry version check). This change is independent and protects the overlay from any other delay. A regression test uses Playwright websocket routing to withhold only the `sync` message. For both the app and pages router, it checks that a module-not-found error still shows the redbox and that the devtools indicator stays hidden. ## Verification Run locally with Turbopack dev and webpack dev: - New `test/development/app-dir/dev-overlay-redbox-before-sync`: fails without this change (no redbox) and passes with it. - `test/development/acceptance/ReactRefreshLogBox-builtins.test.ts` - `test/development/acceptance-app/rsc-build-errors-react-apis-1.test.ts` - `test/development/dev-indicator/dev-indicator.test.ts` - `test/development/app-dir/dev-indicator/hide-button.test.ts` <!-- NEXT_JS_LLM --> <!-- fleet 64c837ee-843c-4c4b-b256-57dd903babf5 --> Co-authored-by:vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by:
Tobias Koppers <1365881+sokra@users.noreply.github.com>
Showing
Please
register
or
sign in
to comment