GuidesUpdated

Why won’t my dev server start in Canopy?

Trace a failed website, API or worker launch through its checkout, command, first error, port and dependencies, then hand the agent a clear fix.

On this page

A red server row can mean a wrong directory, missing runtime, busy port or failed dependency. A green row can still point at the wrong worktree, or at an app whose API is down. Collect the first real error before you ask a coding agent to change application code.

Canopy Servers view for local website, API, and worker commands
Canopy Servers view for local website, API, and worker commands

Find the exact process that failed

In Canopy's Servers view, note the component, working directory, saved command, branch or worktree, state and first error line. Don't diagnose a website from an API log. A saved command is configuration, not proof the process launched. With several worktrees open, the path matters as much as the command.

Let the first error pick the next check

Command not found: check the runtime and whether that checkout has its dependencies installed. Script missing: read the component's package.json; don't invent a command. EADDRINUSE means another server holds the address, so find its owner before stopping it. ECONNREFUSED points to a dependency that isn't accepting connections. An instant exit suggests a missing env value, build error or wrong runtime. Keep the first failure; retries bury it.

A triage map, not a diagnosis from one status code.
First signalCheck nextAvoid
Command or script missingDirectory, runtime, package scripts, installed dependenciesRewriting app code before setup is known
EADDRINUSEWhich process owns the address and which checkout needs itKilling an unknown service or guessing a new URL
ECONNREFUSEDThe named API, database or service and its ready lineTreating a frontend build as end-to-end success
Ready line but wrong pagePrinted host/port, Preview URL, branch, backend requestsTrusting yesterday's browser tab
Worker starts but no job runsWorker registration, dev environment, dashboard run state, task logsAssuming a live terminal means a task ran

Open the URL this run printed

Vite and other dev servers move to the next port when theirs is busy, unless you set strictPort. Use the URL this run printed and match it to the component and checkout before opening Preview. When two agents run frontends in separate worktrees, give each a known port; the port-collision guide covers this. A page loading at localhost isn't proof it's the one the agent changed.

Start dependencies in order

Start the smallest prerequisite first: API ready line, then worker connection, then website URL. Then do one action that should reach the API or worker and compare the request with the logs.

For a Trigger.dev worker, keep `trigger dev` running and confirm registered tasks and a test run in its dashboard. Canopy shows local output; the dashboard is the authority on run state. A stopped worker looks healthy until a job fires.

Hand the agent a bounded startup failure

Give the agent the component, checkout, exact command, first error, expected ready line and what you checked. Ask for a diagnosis before edits. If the fix changes a port or env setup, update the saved command and docs once it works. If it changes code, read the diff.

Restart only the affected components and repeat the original action. Don't let a 'try again' loop spawn duplicate servers. You're done when the service starts, the path works and the changes are reviewable.

Copyable resources

Server startup handoff

Share error text without secrets, tokens or private response bodies.

Component and checkout/branch: [ ]
Working directory and exact command: [ ]
Runtime and dependencies checked: [ ]
First error line, exit code and time: [ ]
Expected ready line and URL: [ ]
Actual host/port, or no ready line: [ ]
Other process or dependency status: [ ]
Browser action and matching API/worker evidence: [ ]
Diagnose before editing, make the smallest justified fix, restart the affected service, repeat the action, and report the diff and check results.

Frequently asked questions

Should I kill whatever owns the port?

Identify the process and checkout first. It may be another project or agent preview. Stop the intended process, or assign a documented separate port.

Why does a ready server still show the old page?

The URL may belong to another worktree or port. Match the printed address, working directory, branch and Preview tab before judging the change.

Does a running Trigger.dev dev command prove my task ran?

No. Check task registration and the specific run in Trigger.dev's dashboard, then compare its logs with the local worker output.

More questions and answers →

Sources and further reading