pbakaus/impeccable · error

{}

Error message

{}

What it means

live_boot's run prints the resolver's error message to stderr and exits with code 1 when resolve_live_target cannot determine the live target for the current working directory. The `{}` placeholder carries the actual reason (e.g. no package.json/dev server found).

Solutions

  1. Run the command from (or point it at) the project root containing package.json.
  2. Start the framework dev server first so the target can be resolved.
  3. Read the printed message (the `{}` content) for the specific resolution failure and adjust the project layout or supported-framework config.

Example fix

// before (run in ~, no project)
$ impeccable live
# error printed, exit 1
// after
$ cd ~/my-app && impeccable live
Defensive patterns

Strategy: validation

Validate before calling

import { existsSync, readFileSync } from 'node:fs';
if (!existsSync('package.json')) throw new Error('Run impeccable live from the project root (package.json not found)');
JSON.parse(readFileSync('package.json', 'utf8'));

Try / catch

const res = await execFile('impeccable', ['live']).catch(e => e);
if (res.code === 1 && res.stderr.includes('live')) {
  console.error('Could not resolve live target: cd into the project root and start the dev server first');
}

Prevention

When it happens

Trigger: Running a live verb from a directory where resolve_live_target fails: no framework project detected, missing package.json, unrecognized dev server config, or unsupported cwd layout.

Common situations: Invoking `impeccable live` outside a project root or in a subdirectory without a resolvable root; a framework the target resolver does not support yet; corrupted or missing package.json.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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

Appendix: source

Thrown at crates/live/src/live_boot.rs:63

fn rel_or_null(base: &str, p: Option<&str>) -> Value {
    match p {
        Some(p) => json!(jsp::relative("/", base, p)),
        None => Value::Null,
    }
}

/// JS: safeRead(p): file text or null (empty text is falsy in the gate).
fn read_nonempty(p: Option<&str>) -> Option<String> {
    p.and_then(safe_read)
}

pub fn run(args: &[String], io: &mut Io) -> i32 {
    let cwd = io.cwd.to_string_lossy().into_owned();
    let env = io.env.clone();
    let live_target = match resolve_live_target(&cwd, args, &env) {
        Ok(t) => t,
        Err(msg) => {
            io.err(&format!("{}\n", msg));
            return 1;
        }
    };
    if args.iter().any(|a| a == "--help" || a == "-h") {
        println(io, HELP);
        return 0;
    }

    if let Some(sel) =
        resolve_target_selection(&live_target.original_cwd, &live_target.target_options, &env)
    {
        let payload = json!({
            "ok": false,
            "error": "target_selection_required",
            "targetPath": null,
            "projectRoot": sel.project_root,
            "repoRoot": sel.repo_root,
            "targetCandidates": sel.target_candidates,

View on GitHub (pinned to f2c7051853)