unslopkit

Components / Code blocks

Error with stack trace

The error type and message up top, then frames that open to show code, the failing line marked with a caret, and library frames folded away.

UnhandledPOST /v2/invoicesstaging

TypeError: Cannot read properties of undefined (reading 'rate')

  1. lineTotalsrc/totals.ts:15:23
    export function lineTotal(l: Line) {
      const price = PRICES[l.sku];
      return l.qty * price.rate;
                     ^^^^^ price is undefined
    }
  2. buildInvoicesrc/invoices.ts:42:18
      for (const line of sheet.lines) {
        totals.push(lineTotal(line));
      }
  3. POSTapp/api/invoices/route.ts:18:9
      const sheet = await getSheet(body.job);
      const draft = buildInvoice(sheet);
  4. 3 frames in node_modules
    • handle @halden/sdk/dist/http.js:88:11
    • dispatch router-lite/index.js:41:7
    • run router-lite/index.js:12:3
Seen 3 times in the last hour
Drawn in your kit, Plain.Change the look

The code

Plain HTML and CSS on your kit's variables. Put it next to tokens/variables.css from your kit's files and it draws in your look.

<div class="ukc-code-stack-trace">
<section class="er" aria-labelledby="ukc-code-stack-trace-title">
  <header class="hd">
    <p class="meta"><span class="tag">Unhandled</span><span>POST /v2/invoices</span><span>staging</span><time datetime="2026-10-22T12:04:31">12:04:31</time></p>
    <h3 class="msg" id="ukc-code-stack-trace-title"><span class="type">TypeError:</span> Cannot read properties of undefined (reading 'rate')</h3>
  </header>
  <ol class="frames">
    <li><details open><summary><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 6l6 6-6 6"/></svg><span class="fn">lineTotal</span><span class="loc">src/totals.ts:15:23</span></summary>
      <pre class="src"><code><span class="l"><span class="g" data-n="13" aria-hidden="true"></span><span class="k">export function</span> <span class="f">lineTotal</span>(l: Line) {</span>
<span class="l"><span class="g" data-n="14" aria-hidden="true"></span>  <span class="k">const</span> price = PRICES[l.sku];</span>
<span class="l bad"><span class="g" data-n="15" aria-hidden="true"></span>  <span class="k">return</span> l.qty * price.rate;</span>
<span class="l why"><span class="g" aria-hidden="true"></span>                 ^^^^^ price is undefined</span>
<span class="l"><span class="g" data-n="16" aria-hidden="true"></span>}</span></code></pre>
    </details></li>
    <li><details><summary><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 6l6 6-6 6"/></svg><span class="fn">buildInvoice</span><span class="loc">src/invoices.ts:42:18</span></summary>
      <pre class="src"><code><span class="l"><span class="g" data-n="41" aria-hidden="true"></span>  <span class="k">for</span> (<span class="k">const</span> line <span class="k">of</span> sheet.lines) {</span>
<span class="l bad"><span class="g" data-n="42" aria-hidden="true"></span>    totals.<span class="f">push</span>(<span class="f">lineTotal</span>(line));</span>
<span class="l"><span class="g" data-n="43" aria-hidden="true"></span>  }</span></code></pre>
    </details></li>
    <li><details><summary><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 6l6 6-6 6"/></svg><span class="fn">POST</span><span class="loc">app/api/invoices/route.ts:18:9</span></summary>
      <pre class="src"><code><span class="l"><span class="g" data-n="17" aria-hidden="true"></span>  <span class="k">const</span> sheet = <span class="k">await</span> <span class="f">getSheet</span>(body.job);</span>
<span class="l bad"><span class="g" data-n="18" aria-hidden="true"></span>  <span class="k">const</span> draft = <span class="f">buildInvoice</span>(sheet);</span></code></pre>
    </details></li>
    <li class="lib"><details><summary><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 6l6 6-6 6"/></svg><span class="fn">3 frames in node_modules</span></summary>
      <ul class="libs"><li>handle <span>@halden/sdk/dist/http.js:88:11</span></li><li>dispatch <span>router-lite/index.js:41:7</span></li><li>run <span>router-lite/index.js:12:3</span></li></ul>
    </details></li>
  </ol>
  <footer class="ft"><button class="btn" type="button"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="8" y="8" width="12" height="12" rx="1"/><path d="M16 8V4H4v12h4"/></svg>Copy trace</button><span class="seen">Seen 3 times in the last hour</span></footer>
</section>
</div>

More code blocks

All 24
  • .env.local4 of 5 set
    1. # Halden, test mode
    2. HALDEN_API_KEY=hidden, ends in 4f9chld_test_8Kq2Vn5x4f9c
    3. HALDEN_ENV=test
    4. DB_PASSWORD=hiddenlocal-dev-only
    5. # Webhooks
    6. HALDEN_WEBHOOK_SECRET=

      Empty Webhook checks fail until this is set. Copy it from Settings, then Webhooks.

    Env file with reveal

  • unpaid.sql
    -- Unpaid and past due, oldest first
    SELECT j.code, c.name, i.total,
      current_date - i.due_on AS late
    FROM invoices i
    JOIN jobs j ON j.id = i.job_id
    JOIN clients c ON c.id = j.client_id
    WHERE i.paid_at IS NULL
      AND i.due_on < current_date
    ORDER BY late DESC;

    4 rows in 18 msExport CSV

    codenametotallate
    JS-2216Pier Ln Holdings6,900.0021
    JS-2207Reyes Framing2,140.009
    JS-2219Mill Lane Lofts1,212.504
    JS-2223O. Whitaker480.001

    Query and result

  • Guides · API keys

    Rotate a key without downtime

    Run halden keys rotate in your project folder. The old key keeps working for 24 hours, so a deploy that still reads HALDEN_KEY won't fail halfway.

    The CLI writes the new key to ~/.halden/config.toml. Rather click than type? Press Ctrl K in the dashboard and search for keys.

    Shortcuts in the docs

    Search the docs
    /
    Copy the focused snippet
    C
    Next or previous heading
    JK

    Inline code and keys

  • Deck INVOICE.FORCard 12 of 40
    00000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111112222222222222222222222222222222222222222222222222222222222222222222222222222222233333333333333333333333333333333333333333333333333333333333333333333333333333333444444444444444444444444444444444444444444444444444444444444444444444444444444445555555555555555555555555555555555555555555555555555555555555555555555555555555566666666666666666666666666666666666666666666666666666666666666666666666666666666777777777777777777777777777777777777777777777777777777777777777777777777777777778888888888888888888888888888888888888888888888888888888888888888888888888888888899999999999999999999999999999999999999999999999999999999999999999999999999999999 TOTAL=HOURS*RATE+PARTSINV00120
    Reads
          TOTAL = HOURS * RATE + PARTS
    • 1 to 5label
    • 6continuation
    • 7 to 72statement
    • 73 to 80sequence

    Punch card

  • LATEFEE.BASLENDING DESK27-NOV-26 PAGE 1

    10 REM LATE FEES, 25 CENTS A DAY AFTER 14 DAYS
    20 READ N
    30 FOR I = 1 TO N
    40 READ T$, D
    50 IF D > 14 THEN PRINT T$; " OWES $"; (D - 14) * .25
    60 NEXT I
    70 DATA 3
    80 DATA "DUNE", 21, "EMMA", 9, "ULYSSES", 30
    90 END
     

    Tear here

    RUN
    DUNE OWES $ 1.75
    ULYSSES OWES $ 4
    READY.
    9 lines · 2 patrons owe fees

    Fanfold printout

  • crontab · roastery-01
    30minute 6hour *day of month *month 1-5day of week

    runs/opt/roastery/bin/roast-plan --notify

    Every weekday at 06:30, Monday to Friday, in any month.

    Cron line, explained