devtools-source-maps
Installation
SKILL.md
Utilizing Source Maps & Structured Stack Traces in DevTools
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.
1. Primary Rules
- Never parse raw error stacks manually: Do not split on newlines or use
homebrew regex to parse stack traces. Use
DebuggerWorkspaceBindinghelpers to structurally parse and translate stack traces. - Dispose of subscriptions: Models like
SymbolizedErrorsubscribe to live locations. Always call.dispose()when the consumer (e.g., a widget or list) is destroyed to avoid memory leaks. - Prefer pre-built widgets: Instead of manually formatting or rendering
call frames, use
StackTracePreviewContentfor raw stacks, andSymbolizedErrorWidgetfor complete errors.