{ stackTrace: 'summary' }Controls whether to forward browser runtime errors to the terminal.
When set to true, Rsbuild's client script listens for window.error events and unhandled Promise rejections in the browser, then sends these errors to the dev server. The server prints them in the terminal with a [browser] prefix, along with improved formatting and contextual information.
This feature is particularly useful when working with AI coding agents that can only read terminal output, helping them better understand runtime errors and assist in debugging.
For example, if you have the following code in your application:
The browser will throw an error, and Rsbuild will forward this error to the terminal:
'summary' | 'full' | 'none''summary'Controls how the error stack trace is displayed in the terminal when forwarding browser errors.
'summary' – Show only the first frame (e.g. (src/App.jsx:3:0)).'full' – Print the full stack trace with all frames.'none' – Hide stack traces.For example, setting stackTrace to 'full':
The full stack trace will be like:
Set dev.browserLogs to false to disable this behavior.
| Version | Changes | 
|---|---|
| v1.5.13 | Added this option | 
| v1.6.0 | Added stackTrace option |