Skip to content

feat: support displaying runtime errors on overlay#6793

Merged
chenjiahan merged 4 commits intomainfrom
runtime_error_1217
Dec 21, 2025
Merged

feat: support displaying runtime errors on overlay#6793
chenjiahan merged 4 commits intomainfrom
runtime_error_1217

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

@chenjiahan chenjiahan commented Dec 17, 2025

Summary

Adds a new client.overlay.runtime option to enable runtime errors to be displayed on the overlay.

image

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings December 17, 2025 08:30
@netlify
Copy link
Copy Markdown

netlify bot commented Dec 17, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit d365c1e
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/694759beb2a01e00088dd5cc
😎 Deploy Preview https://deploy-preview-6793--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 65 (🔴 down 3 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 overlay configuration to support object format with runtime boolean option (default: false)
  • Added clearLogs optional 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 chenjiahan marked this pull request as ready for review December 20, 2025 14:01
@chenjiahan chenjiahan merged commit ff6fa93 into main Dec 21, 2025
11 checks passed
@chenjiahan chenjiahan deleted the runtime_error_1217 branch December 21, 2025 02:45
@nanianlisao
Copy link
Copy Markdown
Contributor

@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

@chenjiahan
Copy link
Copy Markdown
Member Author

Thanks for the suggestion, I will take a look

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants