{"record":{"id":"10f870e114ab9f08","repo":"tauri-apps/tauri","slug":"cannot-use-both-resources-and-resources-map","errorCode":null,"errorMessage":"cannot use both `resources` and `resources_map`","messagePattern":"cannot use both `resources` and `resources_map`","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-bundler/src/bundle/settings.rs","lineNumber":1183,"sourceCode":"\n  /// Returns an iterator over the icon files to be used for this bundle.\n  pub fn icon_files(&self) -> ResourcePaths<'_> {\n    match self.icon_files {\n      Some(ref paths) => ResourcePaths::new(paths.as_slice(), false),\n      None => ResourcePaths::new(&[], false),\n    }\n  }\n\n  /// Returns an iterator over the resource files to be included in this\n  /// bundle.\n  pub fn resource_files(&self) -> ResourcePaths<'_> {\n    match (\n      &self.bundle_settings.resources,\n      &self.bundle_settings.resources_map,\n    ) {\n      (Some(paths), None) => ResourcePaths::new(paths.as_slice(), true),\n      (None, Some(map)) => ResourcePaths::from_map(map, true),\n      (Some(_), Some(_)) => panic!(\"cannot use both `resources` and `resources_map`\"),\n      (None, None) => ResourcePaths::new(&[], true),\n    }\n  }\n\n  /// Returns an iterator over the external binaries to be included in this\n  /// bundle.\n  pub fn external_binaries(&self) -> ResourcePaths<'_> {\n    match self.bundle_settings.external_bin {\n      Some(ref paths) => ResourcePaths::new(paths.as_slice(), true),\n      None => ResourcePaths::new(&[], true),\n    }\n  }\n\n  /// Copies external binaries to a path.\n  ///\n  /// Returns the list of destination paths.\n  pub fn copy_binaries(&self, path: &Path) -> crate::Result<Vec<PathBuf>> {\n    let mut paths = Vec::new();","sourceCodeStart":1165,"sourceCodeEnd":1201,"githubUrl":"https://github.com/tauri-apps/tauri/blob/52e4b6e71d8632a7e648f866c442e287ecddee34/crates/tauri-bundler/src/bundle/settings.rs#L1165-L1201","documentation":"Panic in tauri-bundler's Settings::resource_files(). The bundle configuration accepts resources either as a list/string (resources) or as a mapping of source->target (resourcesMap), and both being set at once is rejected with this panic before any bundling starts.","triggerScenarios":"A tauri.conf.json (or platform-specific config merged on top) that contains both `bundle.resources` and `bundle.resourcesMap` keys after config merging.","commonSituations":"Migrating from the array syntax to the map syntax and forgetting to delete the old key; platform-specific config overlays (tauri.macos.conf.json) adding resourcesMap on top of a base with resources.","solutions":["Keep exactly one form in tauri.conf.json: delete `resources` or delete `resourcesMap`","If you need per-file target paths, convert the whole list into map entries, e.g. \"resourcesMap\": { \"assets/logo.svg\": \"icons/logo.svg\" }","Check platform-specific config overlays for the duplicated key before rebuilding"],"exampleFix":"// before (tauri.conf.json)\n\"bundle\": { \"resources\": [\"assets/*\"], \"resourcesMap\": { \"assets/a.png\": \"a.png\" } }\n\n// after\n\"bundle\": { \"resourcesMap\": { \"assets/*\": \"/\" } }  // or keep only \"resources\": [\"assets/*\"]","handlingStrategy":"validation","validationCode":"import { readFileSync } from 'node:fs';\nconst cfg = JSON.parse(readFileSync('src-tauri/tauri.conf.json', 'utf8'));\nconst { resources, resourcesMap } = cfg.bundle ?? {};\nif (resources && resourcesMap) {\n  throw new Error('bundle.resources and bundle.resourcesMap are mutually exclusive');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Enable the tauri.conf.json JSON schema in your editor to catch conflicts as you type","When migrating resources -> resourcesMap, delete the old key in the same commit","Check platform overlay configs (tauri.*.conf.json) for the duplicated key too"],"tags":["tauri-bundler","resources","config","build"],"backgroundTag":"conflicting-config-options","analyzedSha":"52e4b6e71d8632a7e648f866c442e287ecddee34","analyzedAt":"2026-08-20T13:59:20.734Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}