Skip to content

feat: add stack trace control for browser logs#6425

Merged
chenjiahan merged 3 commits intomainfrom
stack_trace_1024
Oct 24, 2025
Merged

feat: add stack trace control for browser logs#6425
chenjiahan merged 3 commits intomainfrom
stack_trace_1024

Conversation

@chenjiahan
Copy link
Member

Summary

Add support for configuring stack trace display in browser logs through the browserLogs.stackTrace option. The default is set to 'summary' which shows the first frame, while 'none' hides stack traces completely.

Checklist

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

Copilot AI review requested due to automatic review settings October 24, 2025 06:08
@netlify
Copy link

netlify bot commented Oct 24, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit e3b6f05
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/68fb2430e9de130008883c61
😎 Deploy Preview https://deploy-preview-6425--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: 51 (🔴 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.

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 introduces configurable stack trace display for browser logs through a new browserLogs.stackTrace option. The change allows developers to control whether stack traces are shown in full, summarized (first frame only), or hidden completely when browser errors are forwarded to the terminal.

Key Changes:

  • Extends browserLogs configuration from boolean to object with stackTrace option
  • Adds logic to handle stack trace display based on configuration
  • Sets default behavior to 'summary' mode showing only the first frame

Reviewed Changes

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

Show a summary per file
File Description
packages/core/src/types/config.ts Defines new BrowserLogsStackTrace type and extends browserLogs to accept object configuration
packages/core/src/server/browserLogs.ts Implements stack trace control logic by checking configuration and returning early when 'none'
packages/core/src/defaultConfig.ts Updates default config from boolean to object with stackTrace: 'summary'
e2e/cases/browser-logs/stack-trace-none/src/index.js Test file that throws error to verify stack trace hiding
e2e/cases/browser-logs/stack-trace-none/rsbuild.config.ts Test configuration with stackTrace: 'none'
e2e/cases/browser-logs/stack-trace-none/index.test.ts E2E test verifying stack traces are hidden when configured

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

@chenjiahan chenjiahan merged commit 13f686e into main Oct 24, 2025
16 of 17 checks passed
@chenjiahan chenjiahan deleted the stack_trace_1024 branch October 24, 2025 07:19
@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.

1 participant