{"record":{"id":"62b7e377f546c4ec","repo":"tauri-apps/tauri","slug":"failed-to-parse-plugin-manifest-map","errorCode":null,"errorMessage":"failed to parse plugin manifest map","messagePattern":"failed to parse plugin manifest map","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-codegen/src/context.rs","lineNumber":399,"sourceCode":"        );\n      }\n\n      let schema = options.isolation_schema;\n\n      quote!(#root::Pattern::Isolation {\n        assets: ::std::sync::Arc::new(#assets),\n        schema: #schema.into(),\n        key: #key.into(),\n        crypto_keys: std::boxed::Box::new(::tauri::utils::pattern::isolation::Keys::new().expect(\"unable to generate cryptographically secure keys for Tauri \\\"Isolation\\\" Pattern\")),\n      })\n    }\n  };\n\n  let acl_file_path = out_dir.join(ACL_MANIFESTS_FILE_NAME);\n  let acl: BTreeMap<String, Manifest> = if acl_file_path.exists() {\n    let acl_file =\n      std::fs::read_to_string(acl_file_path).expect(\"failed to read plugin manifest map\");\n    serde_json::from_str(&acl_file).expect(\"failed to parse plugin manifest map\")\n  } else {\n    Default::default()\n  };\n\n  let capabilities_file_path = out_dir.join(CAPABILITIES_FILE_NAME);\n  let capabilities_from_files = if capabilities_file_path.exists() {\n    let capabilities_json =\n      std::fs::read_to_string(&capabilities_file_path).expect(\"failed to read capabilities\");\n    serde_json::from_str(&capabilities_json).expect(\"failed to parse capabilities\")\n  } else {\n    Default::default()\n  };\n  let capabilities = get_capabilities(\n    &config,\n    capabilities_from_files,\n    additional_capabilities.as_deref(),\n  )\n  .unwrap();","sourceCodeStart":381,"sourceCodeEnd":417,"githubUrl":"https://github.com/tauri-apps/tauri/blob/460ec35447493200d64290dd7f015d5a91d0fd58/crates/tauri-codegen/src/context.rs#L381-L417","documentation":"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.","triggerScenarios":"`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.","commonSituations":"Killing a build mid-write; mixing tauri-cli versions across builds; hand-editing generated files in the target dir; disk-full leaving partial JSON.","solutions":["Delete the corrupted manifests file or `cargo clean` and rebuild so the CLI regenerates it.","Validate the JSON file manually to confirm corruption (e.g. `python -m json.tool <file>`).","Ensure the tauri CLI version matches the tauri crates in Cargo.toml so schemas align.","Never hand-edit files under the build output directory."],"exampleFix":"# before: corrupted generated file kept failing the build\n# after: remove and regenerate\ncargo clean && cargo tauri build","handlingStrategy":"validation","validationCode":"const fs = require('fs');\nconst file = 'src-tauri/target/<profile>/build/<hash>/out/acl-manifests.json';\nif (fs.existsSync(file)) {\n  try { JSON.parse(fs.readFileSync(file, 'utf8')); }\n  catch (e) { console.error('corrupted manifest map, run cargo clean:', e.message); process.exit(1); }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid killing builds mid-write; let them finish or clean afterwards","Pin matching tauri CLI and crate versions","Never edit files in the build output directory","Run `cargo clean` when switching toolchain or CLI versions"],"tags":["build-time","json","serialization","tauri"],"backgroundTag":"json-parse-error","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"}