pbakaus/impeccable · error

Live server not running. Start one with: {cmd}

Error message

Live server not running. Start one with: {cmd}

What it means

handle_poll_error maps PollError::ConnRefused to this message and exits with code 1. The poller could not open a TCP connection to the local live server, meaning no server is listening on the expected port.

Source

Thrown at crates/live/src/live_poll.rs:647

    print_poll_event(&mut event, io);
    event
}

fn handle_poll_error(err: PollError, io: &mut Io) -> i32 {
    let cwd = io.cwd.to_string_lossy().into_owned();
    let env = io.env.clone();
    match err {
        PollError::Auth => {
            io.err("Authentication failed. The server token may have changed.\n");
            io.err(&format!(
                "Try restarting: {} stop && {}\n",
                script_cmd(&env, &cwd, "live-server"),
                script_cmd(&env, &cwd, "live")
            ));
            1
        }
        PollError::ConnRefused => {
            io.err(&format!(
                "Live server not running. Start one with: {}\n",
                script_cmd(&env, &cwd, "live")
            ));
            1
        }
        PollError::AckTimeout(m) => {
            io.err(&format!("{}\n", m));
            1
        }
        PollError::Other(m) => {
            io.err(&format!("Poll failed: {}\n", m));
            1
        }
    }
}

fn arg_value_int(args: &[String], prefix: &str, default: i64) -> i64 {
    match args.iter().find(|a| a.starts_with(prefix)) {

View on GitHub (pinned to 2bc2879276)

Solutions

  1. Start a live server with the printed command: `<live>` (which boots live-server as needed).
  2. If a server should be running, check its process and port (`lsof -i :<port>`) and restart it.
  3. Delete stale client state/port files for the project and re-run `live` to re-bind.

Example fix

// before
$ impeccable live-poll
Live server not running. Start one with: impeccable live
// after
$ impeccable live   # starts live-server, then polls
Defensive patterns

Strategy: retry

Validate before calling

// Check the port is listening before polling
const net = require('node:net');
const s = net.connect(port, '127.0.0.1');
s.on('error', () => console.error('live-server not listening; start it with `impeccable live`'));
s.on('connect', () => s.end());

Try / catch

for (let i = 0; i < 3; i++) {
  const res = await poll().catch(e => e);
  if (!(res instanceof ConnRefused)) return res;
  await startLiveServer();
  await sleep(500);
}
throw new Error('Live server did not come up');

Prevention

When it happens

Trigger: Poll loop gets connection-refused: live-server was never started, already exited, or listens on a different port than the client's saved state expects.

Common situations: Machine rebooted or server crashed; server killed by Ctrl-C while the poll session persisted; stale port/state file after `live-server stop`; dev-server port changed.

Understand the failure class

Background: ECONNREFUSED and "connection refused" / "could not connect to server" errors: what they mean and how to fix them — this error's family across 44 libraries.

Related errors


AI-assisted analysis of pbakaus/impeccable@2bc2879276 (2026-09-08). Data as JSON: /api/errors/bf298e9081dd6d24. Report an issue: GitHub.