{"record":{"id":"15d55a66f271c3fd","repo":"sxyazi/yazi","slug":"due-to-cargo-s-limitations-yazi-on-crates-io-must-15d55a","errorCode":null,"errorMessage":"Due to Cargo's limitations, Yazi on crates.io must be built with `cargo install --force yazi-build`","messagePattern":"Due to Cargo's limitations, Yazi on crates\\.io must be built with `cargo install --force yazi-build`","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"yazi-fm/build.rs","lineNumber":22,"sourceCode":"\tlet dir = env::var(\"OUT_DIR\").unwrap();\n\n\t// cargo build\n\t//   C:\\Users\\Ika\\Desktop\\yazi\\target\\release\\build\\yazi-fm-cfc94820f71daa30\\out\n\t// cargo install\n\t//   C:\\Users\\Ika\\AppData\\Local\\Temp\\cargo-installTFU8cj\\release\\build\\\n\t// yazi-fm-45dffef2500eecd0\\out\n\n\tif dir.contains(r\"\\release\\build\\yazi-fm-\") {\n\t\tpanic!(\n\t\t\t\"Unwinding must be enabled for Windows. Please use `cargo build --profile release-windows --locked` instead to build Yazi.\"\n\t\t);\n\t}\n\n\tlet manifest = env::var_os(\"CARGO_MANIFEST_DIR\").unwrap().to_string_lossy().replace(r\"\\\", \"/\");\n\tif manifest.contains(\"/git/checkouts/yazi-\")\n\t\t|| manifest.contains(\"/registry/src/index.crates.io-\")\n\t{\n\t\tpanic!(\n\t\t\t\"Due to Cargo's limitations, Yazi on crates.io must be built with `cargo install --force yazi-build`\"\n\t\t);\n\t}\n\n\tOk(())\n}\n","sourceCodeStart":4,"sourceCodeEnd":29,"githubUrl":"https://github.com/sxyazi/yazi/blob/441b332de8b8800e70784cfbfb75369ab51ed9dd/yazi-fm/build.rs#L4-L29","documentation":"Raised by Action::get (yazi-shared/src/event/action.rs:124) when a command/action argument lookup by DataKey finds no entry in the args map. get() is the borrowed read accessor used by every command form (get(\"id\"), first(), second(), seq()); it requires both presence and successful conversion, and absence produces this bail. It signals that the sender did not attach the expected named or positional argument.","triggerScenarios":"A command form calling a.get::<T>(\"name\") or a.first()/a.second() when the action was built without that key; typo or case mismatch in an argument name between emitter and receiver (DataKey::String is exact-match); positional args shifted because an earlier one was omitted; parsing a keymap string whose option syntax did not produce the expected key.","commonSituations":"Custom keymap entries missing a required option (e.g. a command needing --ratio without it); plugin emitting a command with renamed arguments after a yazi upgrade; hand-written Action strings in config where quoting swallowed an argument.","solutions":["Compare the argument name at the emit site with the one the form reads — they must match exactly, including case","Attach the missing argument (use Action::with/with_opt on the Rust side or the correct key in Lua)","For positional args, verify earlier positions are present so indices don't shift","If the argument is genuinely optional, read it with the defaulted accessors (str/bool) or Option-based handling instead of get()"],"exampleFix":"-- before\nya.emit(\"update_spotted\", { lok = lock })  -- receiver reads \"lock\"\n-- after\nya.emit(\"update_spotted\", { lock = lock })","handlingStrategy":"validation","validationCode":"-- Lua: always attach the arguments the receiver reads\nya.emit(\"update\", { id = id, name = name }) -- never omit required keys","typeGuard":null,"tryCatchPattern":"// Rust: tolerate missing optional args\nlet id: Option<u64> = a.get(\"id\").ok();","preventionTips":["Keep emitter argument names identical to the form's get() keys, including case","Prefer named arguments over positional ones to avoid index shifts","For optional values use defaulted accessors (str/bool) or Option on the Rust side","Write a smoke test per custom command that emits with all required args"],"tags":["rust","lua","missing-argument","event-dispatch","yazi"],"backgroundTag":"missing-required-argument","analyzedSha":"441b332de8b8800e70784cfbfb75369ab51ed9dd","analyzedAt":"2026-08-19T05:27:26.468Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}