zellij-org/zellij · error

'{}' is out of date, run `cargo xtask assets`

Error message

'{}' is out of date, run `cargo xtask assets`

What it means

Thrown by `cargo xtask assets --check`: the web-client bundle (app.js, integrity.json, index.html) is regenerated deterministically from the JS modules in zellij-client/assets and compared byte-for-byte with the files on disk. Any mismatch means the committed generated files are stale, so the check aborts and tells you to regenerate.

Source

Thrown at xtask/src/assets.rs:72

pub fn assets(_sh: &Shell, flags: flags::Assets) -> anyhow::Result<()> {
    let msg = if flags.check {
        ">> Checking bundled web client assets"
    } else {
        ">> Bundling web client assets"
    };
    crate::status(msg);
    println!("{}", msg);

    let assets_dir = web_assets_dir();
    let generated = generate(&assets_dir)?;

    if flags.check {
        for (name, contents) in &generated {
            let path = assets_dir.join(name);
            let on_disk = std::fs::read_to_string(&path)
                .with_context(|| format!("failed to read '{}'", path.display()))?;
            if &on_disk != contents {
                return Err(anyhow!(
                    "'{}' is out of date, run `cargo xtask assets`",
                    path.display()
                ));
            }
        }
        return Ok(());
    }

    for (name, contents) in &generated {
        let path = assets_dir.join(name);
        std::fs::write(&path, contents)
            .with_context(|| format!("failed to write '{}'", path.display()))?;
    }
    Ok(())
}

fn web_assets_dir() -> PathBuf {
    crate::project_root().join("zellij-client").join("assets")

View on GitHub (pinned to 98a0837077)

Solutions

  1. Run `cargo xtask assets` from the repo root and commit the regenerated app.js, integrity.json and index.html
  2. If it still fails, `git diff zellij-client/assets` shows exactly which generated file drifted and why
  3. Wire `cargo xtask assets --check` into CI so stale bundles are rejected before merge

Example fix

# before: edit a module, then CI fails with "'app.js' is out of date"
cargo xtask assets --check
# after: regenerate and commit
cargo xtask assets
git add zellij-client/assets
git commit -m "chore: regenerate web client assets"
Defensive patterns

Strategy: validation

Validate before calling

# in CI, always regenerate and assert the tree is clean
cargo xtask assets
git diff --exit-code -- zellij-client/assets || {
  echo "bundled assets out of date; run 'cargo xtask assets' and commit"; exit 1;
}

Try / catch

let out = std::process::Command::new("cargo").args(["xtask", "assets", "--check"]).output()?;
let msg = String::from_utf8_lossy(&out.stderr);
if msg.contains("is out of date, run `cargo xtask assets`") {
    // regenerate and re-verify instead of failing the job
    run!("cargo xtask assets");
} else if !out.status.success() {
    anyhow::bail!("assets check failed: {}", msg);
}

Prevention

When it happens

Trigger: Running `cargo xtask assets --check` after editing any MODULE_ORDER module (e.g. terminal.js, index.js), index.html, or a HASHED_ASSETS file without running `cargo xtask assets` afterwards; the check is typically part of CI.

Common situations: Editing frontend JS and forgetting to regenerate; rebases/merges where generated files conflict or get resolved by hand; line-ending or trailing-newline changes that make the byte comparison fail.

Related errors


AI-assisted analysis of zellij-org/zellij@98a0837077 (2026-08-16). Data as JSON: /api/errors/187cb760ff6910da. Report an issue: GitHub.