Frontend Watch Daemon
Guidance for running and troubleshooting the incremental frontend watch workflow.
Overview
webstir watchlaunches the daemon and streams rebuild results to the .NET CLI runtime.- The browser badge reflects build state: orange for in-progress, green for success, red for errors, and red/gray when disconnected.
- Reload events are debounced so rapid edits coalesce into a single browser refresh.
CLI Commands
- Default workflow:
webstir watch - Manual daemon:
npx webstir-frontend watch-daemon --workspace <absolute-path> - Defer auto-start for manual control: add
--no-auto-start - Enable verbose diagnostics: add
--verbose - Focus on hot-update diagnostics: add
--hmr-verbose - Send a manual change event (stdin JSON):
{"type":"change","path":"/absolute/path/to/file"} - Request a manual reload:
{"type":"reload"} - Shutdown the daemon cleanly:
{"type":"shutdown"}
Verbose Logging
- Toggle verbose mode temporarily with the CLI flag (
--verbose) or setWEBSTIR_FRONTEND_WATCH_VERBOSE=1before runningwebstir watch. - Surface hot-update counters and fallback reasons with
--hmr-verboseor theWEBSTIR_FRONTEND_HMR_VERBOSE=1environment variable. - Verbose mode surfaces detailed diagnostics (builder timings, esbuild stats, context churn); default mode keeps logs quiet.
- HMR verbose mode emits per-update module/style lists, cumulative hot-update vs. reload totals, and fallback reasons when a reload is required.
Failure Recovery
- Restart the daemon: stop
webstir watchwithEnter, then run it again. - If lockfiles drift, delete the lockfile and re-run your package manager (
pnpm installby default); the watch workflow also falls back automatically when the install step fails. - Bypass the daemon with
npx webstir-frontend build --workspace <absolute-path>for one-off builds. - When the badge stays red, inspect the last
frontend.watcherror and re-run with verbose logging if needed.
Fallbacks
- You can revert to the previous per-invocation CLI flow by running
webstir-frontend build/rebuildmanually. - Clearing
build/frontendanddist/frontendis safe; the daemon will repopulate outputs on the next rebuild. - Hot-update stats are included in
frontend.watch.pipeline.successdiagnostics and browser console logs so you can confirm fallbacks stay rare (below 10%).