{"record":{"id":"187cb760ff6910da","repo":"zellij-org/zellij","slug":"is-out-of-date-run-cargo-xtask-assets","errorCode":null,"errorMessage":"'{}' is out of date, run `cargo xtask assets`","messagePattern":"'(.+?)' is out of date, run `cargo xtask assets`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xtask/src/assets.rs","lineNumber":72,"sourceCode":"pub fn assets(_sh: &Shell, flags: flags::Assets) -> anyhow::Result<()> {\n    let msg = if flags.check {\n        \">> Checking bundled web client assets\"\n    } else {\n        \">> Bundling web client assets\"\n    };\n    crate::status(msg);\n    println!(\"{}\", msg);\n\n    let assets_dir = web_assets_dir();\n    let generated = generate(&assets_dir)?;\n\n    if flags.check {\n        for (name, contents) in &generated {\n            let path = assets_dir.join(name);\n            let on_disk = std::fs::read_to_string(&path)\n                .with_context(|| format!(\"failed to read '{}'\", path.display()))?;\n            if &on_disk != contents {\n                return Err(anyhow!(\n                    \"'{}' is out of date, run `cargo xtask assets`\",\n                    path.display()\n                ));\n            }\n        }\n        return Ok(());\n    }\n\n    for (name, contents) in &generated {\n        let path = assets_dir.join(name);\n        std::fs::write(&path, contents)\n            .with_context(|| format!(\"failed to write '{}'\", path.display()))?;\n    }\n    Ok(())\n}\n\nfn web_assets_dir() -> PathBuf {\n    crate::project_root().join(\"zellij-client\").join(\"assets\")","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/zellij-org/zellij/blob/98a0837077492d53dd252ab30bc3e43e41e504f4/xtask/src/assets.rs#L54-L90","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Run `cargo xtask assets` from the repo root and commit the regenerated app.js, integrity.json and index.html","If it still fails, `git diff zellij-client/assets` shows exactly which generated file drifted and why","Wire `cargo xtask assets --check` into CI so stale bundles are rejected before merge"],"exampleFix":"# before: edit a module, then CI fails with \"'app.js' is out of date\"\ncargo xtask assets --check\n# after: regenerate and commit\ncargo xtask assets\ngit add zellij-client/assets\ngit commit -m \"chore: regenerate web client assets\"","handlingStrategy":"validation","validationCode":"# in CI, always regenerate and assert the tree is clean\ncargo xtask assets\ngit diff --exit-code -- zellij-client/assets || {\n  echo \"bundled assets out of date; run 'cargo xtask assets' and commit\"; exit 1;\n}","typeGuard":null,"tryCatchPattern":"let out = std::process::Command::new(\"cargo\").args([\"xtask\", \"assets\", \"--check\"]).output()?;\nlet msg = String::from_utf8_lossy(&out.stderr);\nif msg.contains(\"is out of date, run `cargo xtask assets`\") {\n    // regenerate and re-verify instead of failing the job\n    run!(\"cargo xtask assets\");\n} else if !out.status.success() {\n    anyhow::bail!(\"assets check failed: {}\", msg);\n}","preventionTips":["Regenerate assets with `cargo xtask assets` in the same commit that edits web-client JS","Treat zellij-client/assets/app.js, integrity.json and index.html as build artifacts: never hand-edit them","Run `cargo xtask assets --check` in pre-push hooks or CI to catch staleness early"],"tags":["build","ci","assets","determinism","javascript"],"backgroundTag":null,"analyzedSha":"98a0837077492d53dd252ab30bc3e43e41e504f4","analyzedAt":"2026-08-16T13:02:01.396Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}