GuidesUpdated

Debug an agent-built page with the browser console and network

Collect the failing action, console error, request status, server log and checkout before you ask an agent to fix a broken preview.

On this page

A spinner that never stops can mean a missing API, a rejected request, a JavaScript error or the wrong dev server. The screen rarely says which. Reproduce the failure once and collect the browser's evidence before asking an agent to rewrite UI code.

Canopy project view for inspecting a local application's running result
Canopy project view for inspecting a local application's running result

Reproduce one action on a known checkout

Write down the URL, branch, component and steps from a fresh load to the failure. In Canopy, check the website and API in Servers and open the detected URL in Preview, which includes console and network inspection. A server may be running from another worktree or port, so match its output to the checkout you're editing.

Treat the console message as a clue

Copy the first relevant error with its time, file or stack location and triggering action. An exception can stop a click handler before any request is sent. A 404 can mean a missing asset or endpoint. A CORS message points to a cross-origin boundary; find the matching request. Leave extension warnings and tokens out of the prompt.

Inspect the request behind the symptom

In the Network view, filter to the request from your repeated action. Record method, path, status, timing and a short, safe response excerpt. A 404 suggests a route or proxy mismatch, 401 or 403 an auth problem, and 500 a server failure. No request at all suggests the browser code failed first. Chrome's Network panel also separates CORS errors, blocked requests and transport failures.

Match browser evidence to the right server log

Check a failing API request against the API's own log, not just the frontend build. For a 500, find the matching time and route. For a connection failure, confirm the service started on the expected port. If the response is 200 but the UI breaks, inspect the data and the browser exception. Keep secrets, auth headers and personal data out of shared logs.

Give the agent a bounded failure report

Send the reproduction, evidence, expected result and component. Ask the agent to find the cause before editing, make one scoped change, restart the service and repeat the action. Then review the diff and the running page. If you saw no request or error, say so; the agent can suggest what to check next.

Copyable resources

Browser failure report

Remove credentials and personal data before sharing logs or screenshots.

Checkout/branch and component: [ ]
Page URL and viewport: [ ]
Steps to reproduce: [ ]
Expected result: [ ]
Actual result: [ ]
First relevant console message, file and time: [ ]
Matching request method/path/status, or no request seen: [ ]
Matching server log line, or no log seen: [ ]
Diagnose before editing, make a scoped fix, rerun the app, repeat these steps, and report the final diff and checks run.

Frequently asked questions

A request returned 200. Can the page still be broken?

Yes. The response may hold unexpected data, or JavaScript may fail while rendering it. Compare the response shape and browser error with what you expected.

What if the Network view shows no request?

Check whether the action fired and whether an earlier JavaScript error stopped it. Also confirm you're on the right page and checkout.

Should I paste the entire console log into an agent prompt?

Usually not. Share the first relevant error, the matching request and a short server excerpt, with secrets and personal data removed.

More questions and answers →

Sources and further reading