tauri-apps/tauri · error

The configured frontendDist is the `src-tauri` folder. Pleas

Error message

The configured frontendDist is the `src-tauri` folder. Please isolate your web assets on a separate folder and update `tauri.conf.json > build > frontendDist`.

What it means

A guard against an obviously wrong `frontendDist`: after canonicalizing the path, if its final component is `src-tauri`, the CLI refuses to proceed. Serving the Rust project folder as web assets would bundle your source, Cargo.toml, and binaries into the app.

Source

Thrown at crates/tauri-cli/src/build.rs:230

  if let Some(FrontendDist::Directory(web_asset_path)) = &config.build.frontend_dist {
    if !web_asset_path.exists() {
      let absolute_path = web_asset_path
        .parent()
        .and_then(|p| p.canonicalize().ok())
        .map(|p| p.join(web_asset_path.file_name().unwrap()))
        .unwrap_or_else(|| std::env::current_dir().unwrap().join(web_asset_path));
      crate::error::bail!(
        "Unable to find your web assets, did you forget to build your web app? Your frontendDist is set to \"{}\" (which is `{}`).",
        web_asset_path.display(), absolute_path.display(),
      );
    }
    if web_asset_path
      .canonicalize()
      .fs_context("failed to canonicalize path", web_asset_path.to_path_buf())?
      .file_name()
      == Some(std::ffi::OsStr::new("src-tauri"))
    {
      crate::error::bail!(
          "The configured frontendDist is the `src-tauri` folder. Please isolate your web assets on a separate folder and update `tauri.conf.json > build > frontendDist`.",
        );
    }

    // Issue #13287 - Allow the use of target dir inside frontendDist/distDir
    // https://github.com/tauri-apps/tauri/issues/13287
    let target_path = get_cargo_target_dir(&options.args, dirs.tauri)?;
    let mut out_folders = Vec::new();
    if let Ok(web_asset_canonical) = dunce::canonicalize(web_asset_path) {
      if let Ok(relative_path) = target_path.strip_prefix(&web_asset_canonical) {
        let relative_str = relative_path.to_string_lossy();
        if !relative_str.is_empty() {
          out_folders.push(relative_str.to_string());
        }
      }

      for folder in &["node_modules", "src-tauri"] {
        let sub_path = web_asset_canonical.join(folder);

View on GitHub (pinned to 52e4b6e71d)

Solutions

  1. Point `frontendDist` at your actual web build output, e.g. `"../dist"`
  2. Keep web assets in a dedicated folder outside `src-tauri` and have your frontend bundler emit there

Example fix

// before (tauri.conf.json)
"build": { "frontendDist": "../src-tauri" }

// after
"build": { "frontendDist": "../dist" }
Defensive patterns

Strategy: validation

Validate before calling

# reject a frontendDist that resolves to src-tauri
DIST=$(jq -r '.build.frontendDist' src-tauri/tauri.conf.json)
[ "$(basename "$(cd "src-tauri/$DIST" 2>/dev/null && pwd)")" = "src-tauri" ] && { echo 'frontendDist must not be src-tauri' >&2; exit 1; }

Prevention

When it happens

Trigger: Configuring `"frontendDist": "../src-tauri"` (or a path that canonicalizes to it) in `tauri.conf.json` and building.

Common situations: Confusing `frontendDist` with `devUrl` or with the tauri dir while editing config by hand; scaffolding tools or tutorials that leave a placeholder pointing at the project folder.

Related errors


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