Skip to content

Build console ​

The build console is the strip under the preview that reports every compile. Reach for it when the preview did not change, or when it changed and something is red.

Quick start ​

text
build

Type that in the terminal. The console reads Build ready when the compile passed, or Build failed with the error under it. Press Fix in terminal and the error is prefilled as a prompt for the agent.

How it works ​

Nothing compiles on a server ​

The compiler is esbuild built to WebAssembly, running in a web worker in the page. It handles TypeScript, JSX and TSX, CSS and CSS modules on its own, so a project written in React or TypeScript builds with no toolchain of yours. The edit to preview loop never leaves your machine.

When a build runs ​

Every write from the terminal compiles on its own after a short wait: 150 ms after a lone write, 500 ms after a burst. A second write landing inside the open wait makes it a burst. build skips the wait, and Save & rebuild in the Code tab compiles at once.

What the console says ​

LineWhat it means
Build readyThe compile passed and the preview reloaded
Build failedThe compile stopped, and the Build error panel holds the diagnostic
Built, but the browser refused to install itThe build compiled and the emulated browser rejected the manifest
Built, but a page failed to startA surface threw before it was ready
Built, but the background script hit an errorThe service worker threw

Fix in terminal, Fix in chat ​

A failed build offers one button. In terminal mode it reads Fix in terminal and prefills the prompt line with the error. In chat mode it reads Fix in chat and fills the prompt box. Nothing is sent until you press Enter, so you can add a sentence first.

The prefilled prompt reads:

text
Building the extension failed with this error. Please fix it:

<the build error>

Measuring a cycle ​

loop-trace prints the timing of the last edit-to-paint cycle, one line per span, and a total that is the cycle's own clock:

text
cycle cycle-00 trigger=agent build=build-00
  debounce-wait 500ms
  compile:total 40ms
  remount-to-ready 300ms
  total 845ms

--last N prints the last N cycles and --json prints them raw. Typed in the terminal, loop-trace goes to the agent as a prompt, and the agent runs it for you.

Reference ​

LimitValue
Wait after a lone write150 ms
Wait after a burst of writes500 ms
Cycles loop-trace keeps50
CommandWhat it does
buildCompiles the workspace now and prints the diagnostics
loop-trace [--last N] [--json]Prints the timing of the last cycle, span by span

When it fails ​

  • Build failed names a file the manifest points at. The agent wrote the manifest before the file. Wait for the next write, or run build once the file exists.
  • Built, but the browser refused to install it. The manifest is valid JSON and still wrong for the browser. The line under it carries the browser's reason. Hand it to the agent with Fix in terminal.
  • The repairs did not land. Restore the last known good checkpoint from the header, then describe the change again in smaller steps.
  • loop-trace says there is no cycle. Nothing has been written since the page loaded. Make an edit or run build, then read it again.

Next ​