tauri-apps/tauri · error

failed to parse plugin manifest map

Error message

failed to parse plugin manifest map

What it means

Thrown at build time when the ACL/plugin manifest map file in the build output dir was read successfully but `serde_json::from_str` fails to parse it. The file exists (error 131's read succeeded) but its contents are not valid JSON matching the expected `BTreeMap<String, Manifest>` schema — usually a truncated, hand-edited, or stale/corrupted generated file.

Solutions

  1. Delete the corrupted manifests file or `cargo clean` and rebuild so the CLI regenerates it.
  2. Validate the JSON file manually to confirm corruption (e.g. `python -m json.tool <file>`).
  3. Ensure the tauri CLI version matches the tauri crates in Cargo.toml so schemas align.
  4. Never hand-edit files under the build output directory.

Example fix

# before: corrupted generated file kept failing the build
# after: remove and regenerate
cargo clean && cargo tauri build
Defensive patterns

Strategy: validation

Validate before calling

const fs = require('fs');
const file = 'src-tauri/target/<profile>/build/<hash>/out/acl-manifests.json';
if (fs.existsSync(file)) {
  try { JSON.parse(fs.readFileSync(file, 'utf8')); }
  catch (e) { console.error('corrupted manifest map, run cargo clean:', e.message); process.exit(1); }
}

Prevention

When it happens

Trigger: `tauri build`/`tauri dev` where the generated ACL manifests JSON was truncated by an interrupted previous build, manually edited, or written by an incompatible CLI version.

Common situations: Killing a build mid-write; mixing tauri-cli versions across builds; hand-editing generated files in the target dir; disk-full leaving partial JSON.

Understand the failure class

Background: JSON parse error: "Unexpected token" / "not valid JSON" / "failed to parse" — what JSON parsers are really complaining about — this error's family across 45 libraries.

Related errors


AI-assisted analysis of tauri-apps/tauri@460ec35447 (2026-09-18). Data as JSON: /api/errors/62b7e377f546c4ec. Report an issue: GitHub.

Appendix: source

Thrown at crates/tauri-codegen/src/context.rs:399

        );
      }

      let schema = options.isolation_schema;

      quote!(#root::Pattern::Isolation {
        assets: ::std::sync::Arc::new(#assets),
        schema: #schema.into(),
        key: #key.into(),
        crypto_keys: std::boxed::Box::new(::tauri::utils::pattern::isolation::Keys::new().expect("unable to generate cryptographically secure keys for Tauri \"Isolation\" Pattern")),
      })
    }
  };

  let acl_file_path = out_dir.join(ACL_MANIFESTS_FILE_NAME);
  let acl: BTreeMap<String, Manifest> = if acl_file_path.exists() {
    let acl_file =
      std::fs::read_to_string(acl_file_path).expect("failed to read plugin manifest map");
    serde_json::from_str(&acl_file).expect("failed to parse plugin manifest map")
  } else {
    Default::default()
  };

  let capabilities_file_path = out_dir.join(CAPABILITIES_FILE_NAME);
  let capabilities_from_files = if capabilities_file_path.exists() {
    let capabilities_json =
      std::fs::read_to_string(&capabilities_file_path).expect("failed to read capabilities");
    serde_json::from_str(&capabilities_json).expect("failed to parse capabilities")
  } else {
    Default::default()
  };
  let capabilities = get_capabilities(
    &config,
    capabilities_from_files,
    additional_capabilities.as_deref(),
  )
  .unwrap();

View on GitHub (pinned to 460ec35447)