Stack Trace
A line for a tool call that failed. The error is the title, like "Failed: TypeError"; open it for the stack frames, which can link to the file and line.
Usage
Stack Trace
import { Component, DestroyRef, ViewEncapsulation, inject, signal,} from '@angular/core';import { ScBubble, ScBubbleContent,A Trace line with an error status, collapsible on the frames. Your own frames are links to the file at the line; the framework's fold into a line of their own, so the frames you can fix come first.
Anatomy
import { ScTrace, ScTraceLine, ScTraceIcon, ScTraceTitle, ScTraceCollapsible, ScTraceCollapsibleTrigger, ScTraceCollapsiblePanelContent, ScCollapsible, ScCollapsibleTrigger, ScCollapsiblePanel,} from '@semantic-components/ui';<div scTrace> <div scCollapsible scTraceCollapsible [open]="true"> <button scCollapsibleTrigger scTraceCollapsibleTrigger> <span scTraceLine status="error"> <span scTraceIcon><svg siTerminalIcon></svg></span> <span scTraceTitle>Failed: {{ error }}</span> </span> </button> <div scCollapsiblePanel> <div scTraceCollapsiblePanelContent class="flex flex-col gap-2"> <p class="text-destructive font-mono text-xs">{{ error }}</p> <div scTrace> <a [href]="frameLink"> <span scTraceLine>… in prisma/seed.ts:27</span> </a> </div> </div> </div> </div></div>The title truncates, so the content repeats the whole error at its top.
Sending the stack
A failed tool sends only its error message by default; the server has to send the stack for the frames. A stack shows file paths from your server: send it in development only.
Examples
Every frame in one block: the framework's stay muted, so your own stand out.
Muted frames
TypeError: Cannot read properties of undefined (reading 'total')
- at formatInvoice (app/lib/billing.ts:42:31)
- at InvoiceRow (app/components/invoice-row.tsx:18:12)
- at renderWithHooks (node_modules/react-dom/cjs/react-dom.development.js:14985:18)
- at beginWork (node_modules/react-dom/cjs/react-dom.development.js:19049:16)
import { Component, ViewEncapsulation } from '@angular/core';import { ScCollapsible, ScCollapsiblePanel, ScCollapsibleTrigger, ScTrace, ScTraceCollapsible, ScTraceCollapsiblePanelContent, ScTraceCollapsibleTrigger, ScTraceIcon,RTL
import { Dir } from '@angular/cdk/bidi';import { Component, LOCALE_ID, ViewEncapsulation } from '@angular/core';import { RouterLink } from '@angular/router';import { ScCollapsible, ScCollapsiblePanel, ScCollapsibleTrigger, ScTrace, ScTraceCollapsible, ScTraceCollapsiblePanelContent,API reference
See the Trace.