feat: add stack trace control for browser logs#6425
Merged
chenjiahan merged 3 commits intomainfrom Oct 24, 2025
Merged
Conversation
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
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
browserLogsconfiguration from boolean to object withstackTraceoption - 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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