Skip to content

Conversation

@chenjiahan
Copy link
Member

Summary

Simplify file paths when printing browser logs with full stack trace:

- at ./src/index.js (src/index.js:3:0)
+ at src/index.js: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 12:15
@netlify
Copy link

netlify bot commented Oct 25, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 80e40b5
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/68fcbf4d6c00820008100f81
😎 Deploy Preview https://deploy-preview-6434--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: 66 (🔴 down 2 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 simplifies the format of file paths in browser error stack traces by removing redundant path information when the method name would be a file path.

  • Extracts duplicate logic into a reusable isValidMethodName helper function
  • Updates stack trace formatting to exclude file paths from the method name position
  • Updates test expectations to reflect the simplified format

Reviewed Changes

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

File Description
packages/core/src/server/browserLogs.ts Adds isValidMethodName helper to detect and filter out file paths from method names, replacing duplicate validation logic
e2e/cases/browser-logs/stack-trace-full/index.test.ts Updates expected stack trace format to reflect simplified output without duplicate file path in method name position

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

@chenjiahan chenjiahan merged commit 0b84c08 into main Oct 26, 2025
12 checks passed
@chenjiahan chenjiahan deleted the browser_logs_simplify_1025 branch October 26, 2025 08:30
@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