Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Guidelines for utilizing source maps and structured stack traces in DevTools. Covers DebuggerWorkspaceBinding, StackTrace, SymbolizedError, and related UI widgets.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -42% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -37% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -42% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -55% | 0% |
| case-06 | ✗→✓ | ▲ Improved | -27% | 0% |
This skill guides you on how to correctly map runtime coordinates to original source locations and render structured stack traces or symbolized errors in the DevTools frontend.
homebrew regex to parse stack traces. Use DebuggerWorkspaceBinding helpers to structurally parse and translate stack traces.
SymbolizedError subscribe tolive locations. Always call .dispose() when the consumer (e.g., a widget or list) is destroyed to avoid memory leaks.
call frames, use StackTracePreviewContent for raw stacks, and SymbolizedErrorWidget for complete errors.
front_end/models/stack_trace/)A structured representation of a call stack (synchronous + asynchronous segments).
StackTrace / ParsedErrorStackTrace / DebuggableStackTrace:Dispatches a StackTrace.Events.UPDATED event when the original sources are fully resolved or update.
Frame: Represents a single frame, which contains uiSourceCode,url, line/column info, untranslated rawName, translated name, and inline information.
front_end/models/bindings/SymbolizedError.ts)A union type representing a fully symbolized error.
SymbolizedErrorObject: Contains error message, stackTrace (as aParsedErrorStackTrace), and an optional cause (another SymbolizedError). Also holds compile/eval syntaxErrorLocation.
UnparsableError: Fallback when parsing fails.Translates raw coordinates into UI-friendly original source coordinates:
tsconst uiLocation = await Bindings.DebuggerWorkspaceBinding.instance() .rawLocationToUILocation(rawLocation);
ts const stack = await Bindings.DebuggerWorkspaceBinding.instance() .createStackTraceFromProtocolRuntime(protocolStackTrace, target);
ts const stack = await Bindings.DebuggerWorkspaceBinding.instance() .createStackTraceFromDebuggerPaused(pausedDetails, target);
ts const stack = await Bindings.DebuggerWorkspaceBinding.instance() .createStackTraceFromErrorStackLikeString(target, stackString, exceptionDetails);
ts const symbolizedError = await Bindings.DebuggerWorkspaceBinding.instance() .createSymbolizedError(remoteObject, exceptionDetails);
Renders a structured StackTrace inside Shadow DOM. Handles expandable UI and collapsing ignore-listed files.
tsimport * as Components from '../../ui/legacy/components/utils/utils.js'; import * as Workspace from '../../models/workspace/workspace.js'; const preview = new Components.JSPresentationUtils.StackTracePreviewContent(); preview.stackTrace = stackTrace; preview.options = { expandable: true, showColumnNumber: true, ignoreListManager: Workspace.IgnoreListManager.IgnoreListManager.instance(), }; this.contentElement.appendChild(preview.element);
Displays a complete SymbolizedError including recursive causal chains ("Caused by: ...") and syntax error locations.
tsimport * as Panels from '../../panels/panels.js'; import * as Workspace from '../../models/workspace/workspace.js'; const errorWidget = new Panels.Console.SymbolizedErrorWidget(); errorWidget.error = symbolizedError; errorWidget.ignoreListManager = Workspace.IgnoreListManager.IgnoreListManager .instance(); this.contentElement.appendChild(errorWidget.element);
symbolizedError.dispose() is calledon consumer widget cleanup.
ignoreListManager set.correctly via original source maps.
Other measured skills in the registry, with their headline benchmark lift.