tauri-apps/tauri · error · anyhow::Error

The ` ` dependency features on the `Cargo.toml` file does…

Error message

      The `{}` dependency features on the `Cargo.toml` file does not match the allowlist defined under `tauri.conf.json`.
      Please run `tauri dev` or `tauri build` or {}.
    

What it means

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.

Solutions

  1. Run `tauri dev` or `tauri build` once — the CLI synchronizes Cargo.toml features with the allowlist.
  2. Or manually align both sides: enable the matching allowlist key (e.g. `allowlist > dialog > all: true`) or remove the extra Cargo feature.
  3. Avoid hand-editing generated feature lists; make allowlist changes in tauri.conf.json and let the CLI regenerate.

Example fix

// before
// Cargo.toml: tauri = { version = "1", features = ["dialog-all"] }
// tauri.conf.json: "allowlist": { "dialog": { "all": false } }

// after
// tauri.conf.json: "allowlist": { "dialog": { "all": true } }
// then run: tauri build   (or let it sync Cargo.toml)
Defensive patterns

Strategy: fallback

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of tauri-apps/tauri@52e4b6e71d (2026-08-20). Data as JSON: /api/errors/0f87feb12d646dfd. Report an issue: GitHub.

Appendix: source

Thrown at crates/tauri-build/src/manifest.rs:72

        .filter(|f| f != &"tray-icon")
        .map(|f| f.to_string())
        .collect::<Vec<String>>(),
    },
  ];

  for metadata in dependencies {
    let mut name = metadata.name.clone();
    let mut deps = find_dependency(manifest, &metadata.name, metadata.kind);
    if deps.is_empty() {
      if let Some(alias) = &metadata.alias {
        deps = find_dependency(manifest, alias, metadata.kind);
        name.clone_from(alias);
      }
    }

    for dep in deps {
      if let Err(error) = check_features(dep, &metadata) {
        return Err(anyhow!("
      The `{}` dependency features on the `Cargo.toml` file does not match the allowlist defined under `tauri.conf.json`.
      Please run `tauri dev` or `tauri build` or {}.
    ", name, error));
      }
    }
  }

  Ok(())
}

fn find_dependency(manifest: &mut Manifest, name: &str, kind: DependencyKind) -> Vec<Dependency> {
  let dep = match kind {
    DependencyKind::Build => manifest.build_dependencies.remove(name),
    DependencyKind::Normal => manifest.dependencies.remove(name),
  };

  if let Some(dep) = dep {
    vec![dep]

View on GitHub (pinned to 52e4b6e71d)