{"record":{"id":"e96bb801374d894a","repo":"tauri-apps/tauri","slug":"the-configured-frontenddist-includes-the","errorCode":null,"errorMessage":"The configured frontendDist includes the `{:?}` {}. Please isolate your web assets on a separate folder and update `tauri.conf.json > build > frontendDist`.","messagePattern":"The configured frontendDist includes the `(.+?)` (.+?)\\. Please isolate your web assets on a separate folder and update `tauri\\.conf\\.json > build > frontendDist`\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-cli/src/build.rs","lineNumber":256,"sourceCode":"    let mut out_folders = Vec::new();\n    if let Ok(web_asset_canonical) = dunce::canonicalize(web_asset_path) {\n      if let Ok(relative_path) = target_path.strip_prefix(&web_asset_canonical) {\n        let relative_str = relative_path.to_string_lossy();\n        if !relative_str.is_empty() {\n          out_folders.push(relative_str.to_string());\n        }\n      }\n\n      for folder in &[\"node_modules\", \"src-tauri\"] {\n        let sub_path = web_asset_canonical.join(folder);\n        if sub_path.is_dir() {\n          out_folders.push(folder.to_string());\n        }\n      }\n    }\n\n    if !out_folders.is_empty() {\n      crate::error::bail!(\n        \"The configured frontendDist includes the `{:?}` {}. Please isolate your web assets on a separate folder and update `tauri.conf.json > build > frontendDist`.\",\n        out_folders,\n        if out_folders.len() == 1 { \"folder\" } else { \"folders\" }\n      );\n    }\n  }\n\n  if options.runner.is_none() {\n    options.runner = config.build.runner.clone();\n  }\n\n  options\n    .features\n    .extend_from_slice(config.build.features.as_deref().unwrap_or_default());\n  interface.build_options(&mut options.args, &mut options.features, mobile);\n\n  Ok(())\n}","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/tauri-apps/tauri/blob/52e4b6e71d8632a7e648f866c442e287ecddee34/crates/tauri-cli/src/build.rs#L238-L274","documentation":"The CLI scans the canonicalized `frontendDist` for cargo `target/` output (issue #13287) and for `node_modules` and `src-tauri` subdirectories. If any are found, it aborts because bundling would embed hundreds of megabytes of dependencies or your whole Rust project into the app binary.","triggerScenarios":"Setting `frontendDist` to the project root (`\"../\"`) so it swallows `node_modules/` and `src-tauri/`; a frontend bundler configured to emit into the repo root; a cargo target directory placed inside the frontend output folder.","commonSituations":"Trying to serve the repo root to avoid configuring a bundler outDir; vite/webpack `outDir` left at default while `frontendDist` points at a parent; `CARGO_TARGET_DIR` set to a path under `dist/`.","solutions":["Configure your frontend bundler to emit into a dedicated output dir (e.g. vite `build.outDir: 'dist'`) and point `frontendDist` there","If you use a custom cargo target dir, move it outside `frontendDist`","Remove stray `node_modules`/`src-tauri` folders accidentally created inside the dist folder, then rebuild"],"exampleFix":"// before (tauri.conf.json + vite.config)\n\"frontendDist\": \"../\"           // project root contains node_modules & src-tauri\n\n// after (vite.config.ts: build.outDir = 'dist')\n\"frontendDist\": \"../dist\"","handlingStrategy":"validation","validationCode":"# abort if frontendDist swallows node_modules, src-tauri, or a target dir\nDIST=$(jq -r '.build.frontendDist' src-tauri/tauri.conf.json)\nROOT=\"src-tauri/$DIST\"\nfor bad in node_modules src-tauri target; do\n  [ -e \"$ROOT/$bad\" ] && { echo \"frontendDist contains $bad\" >&2; exit 1; }\ndone","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Configure the bundler outDir (e.g. vite `build.outDir: 'dist'`) and point `frontendDist` only at it","Never set `frontendDist` to the repo root (`../`)","Keep `CARGO_TARGET_DIR` outside the frontend output folder"],"tags":["tauri-cli","config","frontend-dist","build","bloat-guard"],"backgroundTag":"misconfigured-frontend-dist","analyzedSha":"52e4b6e71d8632a7e648f866c442e287ecddee34","analyzedAt":"2026-08-20T13:59:20.734Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}