Files
Jiwon ChoiandGitHub 1e27d5e687 Keep Instant DevTools locked when opening error overlay (#94357)
### Why?

The Instant DevTools closes when opening the error overlay and continues
hydration. This is annoying when I wanted to check the error, but didn't
mean to stop the capture.

Before:


[github.com/user-attachments/assets/f1de72a9-5a2b-4e4e-bd7e-e7f36c975ea7](https://github.com/user-attachments/assets/f1de72a9-5a2b-4e4e-bd7e-e7f36c975ea7)

After:


https://github.com/user-attachments/assets/f060e11e-9d60-43f6-a1fd-ca735fad1aa1
2026-06-05 17:19:29 +00:00

23 lines
666 B
TypeScript

'use client'
export function ErrorTrigger() {
return (
<button
type="button"
data-testid="trigger-error"
onClick={() => {
// Throw asynchronously so the error is reported to the dev overlay's
// issue list (the badge toast) WITHOUT auto-opening the overlay. A
// render-time throw would be caught by AppDevOverlayErrorBoundary, which
// calls openErrorOverlay() and auto-opens the overlay, preempting the
// toast-click path these tests exercise.
setTimeout(() => {
throw new Error('Instant nav devtools test error')
})
}}
>
Trigger error
</button>
)
}