StoicBuilder

HandbookV the OfficinaDebugging in the console

Vthe Officina, Use the tools

Debugging in the console

1 min readUpdated 28 November

In plain words

The Console is the DevTools panel where your page's errors appear in red and console.log lines print, so you can see the values at the moment something breaks.

Where you see it

Press Ctrl+Shift+J (Cmd+Option+J on a Mac) to open DevTools on the Console. Each error shows a file and line on the right, such as CartTotal.tsx:12, and clicking it jumps to that spot in the code.

Consolebrowser
console.log("cart at checkout", cart);console.table(cart.items); Uncaught TypeError: Cannot read properties of undefined (reading 'price') at CartTotal (CartTotal.tsx:12:31)
A labelled log shows what the code saw. The red error says what broke, and where.

What goes wrong

  1. Looking for server logs in the browser

    console.log in an API route or a Supabase Edge Function prints in the terminal running your app, or in your host's logs. The browser's Console never sees it.

  2. Chasing the last error instead of the first

    One early failure often sets off a cascade of red lines below it. Fix the first one, reload, and see what's left.

  3. Pasting code a stranger sends you

    Code pasted into the Console runs as you, with your login. Chrome may make you type allow pasting first, for exactly this reason.

What to tell your agent

Copy this into Lovable, Bolt, Cursor or any agent
Add temporary console.log lines with clear labels around the code that's failing, so I can read each value in the Console when I repeat the bug. Tell me exactly what to click, and remove the logs once we've found the cause.

Quick check

Sign in to earn +10 XP for it

Your agent added console.log to a Next.js API route, but nothing appears in the browser's Console. Why?

Got a prompt that touches debugging in the console?

Paste it. You get a better prompt first, then the cards that explain it.

Check your own prompt

Free, no sign-up.