feat: support displaying runtime errors on overlay#6793
Conversation
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
This PR adds support for displaying runtime errors in the error overlay by extending the dev.client.overlay configuration to accept an object with a runtime property. When enabled, runtime JavaScript errors that occur in the browser will be captured and displayed in the same overlay used for compilation errors.
Key Changes:
- Extended
overlayconfiguration to support object format withruntimeboolean option (default: false) - Added
clearLogsoptional property to error messages to control whether console should be cleared - Implemented runtime error rendering in the overlay by capturing client errors and sending them through the WebSocket connection
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/types/config.ts | Extends overlay config type to support object format with runtime property |
| packages/core/src/server/socketServer.ts | Adds logic to render runtime errors in overlay and includes clearLogs flag in error messages |
| packages/core/src/client/hmr.ts | Updates handleErrors to support optional clearLogs parameter for runtime errors |
| examples/react/src/index.tsx | Adds test errors for demonstrating the runtime error overlay feature |
| examples/react/rsbuild.config.ts | Enables runtime error overlay in example configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@chenjiahan hah, I feel that the UI in this PR is more intuitive, allowing you to directly see the source code information and navigate to relevant sections. #2310 |
|
Thanks for the suggestion, I will take a look |

Summary
Adds a new
client.overlay.runtimeoption to enable runtime errors to be displayed on the overlay.Related Links
Checklist