{"record":{"id":"1b0df3146cb549a0","repo":"tauri-apps/tauri","slug":"the-dependency-features-on-the-cargo-toml-file-does-not","errorCode":null,"errorMessage":"The `{}` dependency features on the `Cargo.toml` file does not match the allowlist defined under `tauri.conf.json`.\nPlease run `tauri dev` or `tauri build`","messagePattern":"The `(.+?)` dependency features on the `Cargo\\.toml` file does not match the allowlist defined under `tauri\\.conf\\.json`\\.\nPlease run `tauri dev` or `tauri build`","errorType":"exception","errorClass":null,"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/460ec35447493200d64290dd7f015d5a91d0fd58/crates/tauri-build/src/manifest.rs#L54-L90","documentation":"tauri-build's manifest check compares the features enabled on tauri-related dependencies in Cargo.toml against the allowlist in tauri.conf.json; a mismatch means generated/checked metadata is stale, so the build stops and asks the user to regenerate via the CLI.","triggerScenarios":"Hand-editing Cargo.toml features for the `tauri` dependency (or inlined plugin deps) without regenerating, or editing the tauri.conf.json allowlist without running `tauri dev`/`tauri build`, during ManifestRef check.","commonSituations":"Manually adding/removing features like `protocol-asset`, using `cargo add tauri --features ...` directly, or CI running plain `cargo build` after a config change without invoking the tauri CLI.","solutions":["Run `tauri dev` or `tauri build` (the CLI) to regenerate and sync the manifest","Align Cargo.toml features with the tauri.conf.json allowlist manually","In CI, invoke the tauri CLI build instead of bare `cargo build`"],"exampleFix":"// before (Cargo.toml, allowlist has no fs)\ntauri = { version = \"2\", features = [\"fs-all\"] }\n// after\ntauri = { version = \"2\", features = [] }  // or update tauri.conf.json allowlist, then run tauri build","handlingStrategy":"validation","validationCode":"// before building, let the CLI sync the manifest:\n// npx tauri build / tauri dev — or verify features match the allowlist\nconst allowlistFeatures = deriveFromAllowlist(cfg); // tauri CLI does this\nconst cargoFeatures = tauriDep.features;\nif (JSON.stringify(allowlistFeatures.sort()) !== JSON.stringify([...cargoFeatures].sort())) {\n  throw new Error('Cargo.toml tauri features out of sync with tauri.conf.json allowlist');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await cargoBuild();\n} catch (e) {\n  if (String(e).includes('does not match the allowlist')) {\n    throw new Error('Run `tauri dev` or `tauri build` to regenerate the manifest');\n  }\n  throw e;\n}","preventionTips":["Never hand-edit tauri dependency features; change the allowlist and let the CLI sync","In CI, always build through the tauri CLI, not bare cargo build","After changing tauri.conf.json, expect one regenerating dev/build run"],"tags":["cargo","manifest","allowlist","config-sync"],"backgroundTag":"schema-validation-failed","analyzedSha":"460ec35447493200d64290dd7f015d5a91d0fd58","analyzedAt":"2026-09-18T23:55:51.277Z","contentChangedAt":"2026-09-18T23:55:51.277Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}