{"record":{"id":"0f87feb12d646dfd","repo":"tauri-apps/tauri","slug":"the-dependency-features-on-the-cargo","errorCode":null,"errorMessage":"\n      The `{}` dependency features on the `Cargo.toml` file does not match the allowlist defined under `tauri.conf.json`.\n      Please run `tauri dev` or `tauri build` or {}.\n    ","messagePattern":"\n      The `(.+?)` dependency features on the `Cargo\\.toml` file does not match the allowlist defined under `tauri\\.conf\\.json`\\.\n      Please run `tauri dev` or `tauri build` or (.+?)\\.\n    ","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tauri-build/src/manifest.rs","lineNumber":72,"sourceCode":"        .filter(|f| f != &\"tray-icon\")\n        .map(|f| f.to_string())\n        .collect::<Vec<String>>(),\n    },\n  ];\n\n  for metadata in dependencies {\n    let mut name = metadata.name.clone();\n    let mut deps = find_dependency(manifest, &metadata.name, metadata.kind);\n    if deps.is_empty() {\n      if let Some(alias) = &metadata.alias {\n        deps = find_dependency(manifest, alias, metadata.kind);\n        name.clone_from(alias);\n      }\n    }\n\n    for dep in deps {\n      if let Err(error) = check_features(dep, &metadata) {\n        return Err(anyhow!(\"\n      The `{}` dependency features on the `Cargo.toml` file does not match the allowlist defined under `tauri.conf.json`.\n      Please run `tauri dev` or `tauri build` or {}.\n    \", name, error));\n      }\n    }\n  }\n\n  Ok(())\n}\n\nfn find_dependency(manifest: &mut Manifest, name: &str, kind: DependencyKind) -> Vec<Dependency> {\n  let dep = match kind {\n    DependencyKind::Build => manifest.build_dependencies.remove(name),\n    DependencyKind::Normal => manifest.dependencies.remove(name),\n  };\n\n  if let Some(dep) = dep {\n    vec![dep]","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/tauri-apps/tauri/blob/52e4b6e71d8632a7e648f866c442e287ecddee34/crates/tauri-build/src/manifest.rs#L54-L90","documentation":"A Tauri v1-era consistency check in tauri-build: each Cargo dependency feature that maps to a capability (via the `tauri-build` metadata on dependencies) must match the corresponding allowlist switch in tauri.conf.json. When `check_features` reports a mismatch, this error names the dependency and tells you to run `tauri dev`/`tauri build`, which rewrites Cargo.toml features to match the config.","triggerScenarios":"Hand-editing Cargo.toml to add a tauri plugin dependency feature (e.g. enabling `dialog-all` on the `tauri-plugin-dialog` style dep) without enabling the matching allowlist entry in tauri.conf.json — or vice versa — then building with plain `cargo build` so tauri's sync step never ran.","commonSituations":"IDE auto-adds a feature to Cargo.toml; developers editing the allowlist in tauri.conf.json directly; building with cargo rather than the tauri CLI, which skips the feature-sync pass.","solutions":["Run `tauri dev` or `tauri build` once — the CLI synchronizes Cargo.toml features with the allowlist.","Or manually align both sides: enable the matching allowlist key (e.g. `allowlist > dialog > all: true`) or remove the extra Cargo feature.","Avoid hand-editing generated feature lists; make allowlist changes in tauri.conf.json and let the CLI regenerate."],"exampleFix":"// before\n// Cargo.toml: tauri = { version = \"1\", features = [\"dialog-all\"] }\n// tauri.conf.json: \"allowlist\": { \"dialog\": { \"all\": false } }\n\n// after\n// tauri.conf.json: \"allowlist\": { \"dialog\": { \"all\": true } }\n// then run: tauri build   (or let it sync Cargo.toml)","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always build through `tauri dev`/`tauri build` rather than plain `cargo build` so features stay synced with the allowlist.","Change capabilities in tauri.conf.json and let the CLI rewrite Cargo.toml; don't hand-edit generated features.","After editing either file, run a fast `tauri build --debug` to trigger the sync before pushing."],"tags":["tauri-build","v1","allowlist","cargo-features","config-sync"],"backgroundTag":"cargo-feature-mismatch","analyzedSha":"52e4b6e71d8632a7e648f866c442e287ecddee34","analyzedAt":"2026-08-20T13:59:20.734Z","contentChangedAt":"2026-08-20T13:59:20.734Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}