Skip to content

Conversation

@chenjiahan
Copy link
Member

Summary

Should skip anonymous frame when forwarding browser error logs to the terminal.

  • Enhance source frame detection to better locate user code
  • Ensure error location is only appended when available
  • Add test cases for different React error scenarios

Checklist

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

Copilot AI review requested due to automatic review settings September 26, 2025 09:11
@netlify
Copy link

netlify bot commented Sep 26, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 5953b77
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/68d65b806ac0d40009e85b2b
😎 Deploy Preview https://deploy-preview-6261--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 5 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.

@chenjiahan chenjiahan changed the title feat(browser-logs): should skip anonymous frame fix(browser-logs): should skip anonymous frame Sep 26, 2025
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 browser error log forwarding to skip anonymous frames and better locate user code when reporting runtime errors to the terminal.

  • Introduces findSourceFrame function to identify the first stack frame containing user code
  • Updates resolveSourceLocation to use the new frame detection logic instead of always using the first frame
  • Adds comprehensive test coverage for React error scenarios (undefined property access, effect errors, and event handler errors)

Reviewed Changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated no comments.

File Description
packages/core/src/server/browserLogs.ts Core logic enhancement to skip anonymous frames and improve source location detection
e2e/cases/browser-logs/react-error/src/*.jsx Test components demonstrating different React error scenarios
e2e/cases/browser-logs/react-error/rsbuild.config.ts Configuration for React error test cases
e2e/cases/browser-logs/react-error/index.test.ts E2E tests validating error location reporting

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@chenjiahan chenjiahan merged commit 341e48c into main Sep 26, 2025
11 checks passed
@chenjiahan chenjiahan deleted the browser_logs_frame_0926 branch September 26, 2025 09:35
@chenjiahan chenjiahan mentioned this pull request Sep 29, 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