Skip to content

Conversation

@chenjiahan
Copy link
Member

@chenjiahan chenjiahan commented Oct 25, 2025

Summary

Add method name to error logs when available and improve the formatting of stack traces. This provides more context about where errors occur in the code.

error   [browser] Uncaught TypeError: Cannot read properties of undefined (reading 'name')
- (src/App.jsx:3:0)
+ at handleClick (src/App.jsx:3:0)

Checklist

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

Copilot AI review requested due to automatic review settings October 25, 2025 05:04
@netlify
Copy link

netlify bot commented Oct 25, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit cb31a42
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/68fc5a7d083bfd0009184a08
😎 Deploy Preview https://deploy-preview-6433--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: 62 (no change from production)
Accessibility: 97 (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.

Copy link
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 enhances error logging by adding method names to error stack summaries, providing better context about where errors occur. The change updates both the logging implementation and the corresponding documentation examples.

Key Changes:

  • Modified error log formatting to include method names (e.g., at handleClick) before file locations
  • Added filtering to exclude unhelpful method names like <unknown> or file paths
  • Updated return type of resolveOriginalLocation to include both frame and location information

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/core/src/server/browserLogs.ts Core implementation changes for adding method names to error summaries and updating type definitions
website/docs/en/config/dev/browser-logs.mdx English documentation update showing the new error format with method names
website/docs/zh/config/dev/browser-logs.mdx Chinese documentation update showing the new error format with method names
e2e/cases/browser-logs/react-error/index.test.ts Updated test expectations for React error logs to include method names
e2e/cases/browser-logs/vue-error/index.test.ts Updated test expectations for Vue error logs to include method names

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chenjiahan chenjiahan merged commit 479c05c into main Oct 25, 2025
13 checks passed
@chenjiahan chenjiahan deleted the browser_logs_summary_method_1025 branch October 25, 2025 11:58
@chenjiahan chenjiahan mentioned this pull request Oct 30, 2025
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.

2 participants