{"record":{"id":"7051d3e7ec7fd581","repo":"tauri-apps/tauri","slug":"the-frontenddist-configuration-is-set-to-path","errorCode":null,"errorMessage":"The `frontendDist` configuration is set to `{path:?}` but this path doesn't exist","messagePattern":"The `frontendDist` configuration is set to `(.+?)` but this path doesn't exist","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-codegen/src/context.rs","lineNumber":188,"sourceCode":"    config.app.security.csp.as_ref()\n  };\n  if csp.is_some() {\n    options = options.with_csp();\n  }\n\n  let assets = if let Some(assets) = assets {\n    quote!(#assets)\n  } else if dev && config.build.dev_url.is_some() {\n    let assets = EmbeddedAssets::default();\n    quote!(#assets)\n  } else {\n    let assets = match &config.build.frontend_dist {\n      Some(url) => match url {\n        FrontendDist::Url(_url) => Default::default(),\n        FrontendDist::Directory(path) => {\n          let assets_path = config_parent.join(path);\n          if !assets_path.exists() {\n            panic!(\n              \"The `frontendDist` configuration is set to `{path:?}` but this path doesn't exist\"\n            )\n          }\n          EmbeddedAssets::new(assets_path, &options, map_core_assets(&options))?\n        }\n        FrontendDist::Files(files) => EmbeddedAssets::new(\n          files\n            .iter()\n            .map(|p| config_parent.join(p))\n            .collect::<Vec<_>>(),\n          &options,\n          map_core_assets(&options),\n        )?,\n        _ => unimplemented!(),\n      },\n      None => Default::default(),\n    };\n    quote!(#assets)","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/tauri-apps/tauri/blob/52e4b6e71d8632a7e648f866c442e287ecddee34/crates/tauri-codegen/src/context.rs#L170-L206","documentation":"Compile-time panic in tauri-codegen (running inside the app crate's build via tauri::generate_context!). When no explicit assets are provided and dev has no dev_url, it maps build.frontendDist; for a FrontendDist::Directory it joins the configured path onto the config parent and panics if that directory does not exist on disk.","triggerScenarios":"`tauri build` (or cargo build without a dev server) while `build.frontendDist` points at a folder that was never produced: '../dist' that no tooling generates, a wrong relative path, or the frontend build step never ran.","commonSituations":"Forgot `npm run build` before building the Rust side; CI job running cargo build/tauri build without the frontend build step; monorepos where the dist output lands in a different package; typo'd frontendDist value; git not tracking the generated dist folder on a fresh clone.","solutions":["Run the frontend build first (`npm run build`) or set build > beforeBuildCommand so `tauri build` does it for you","Fix the build.frontendDist path (relative to the folder containing tauri.conf.json, typically '../dist')","Verify the folder exists right before building: `test -d ../dist || npm run build`"],"exampleFix":"# before\ntauri.conf.json: \"build\": { \"frontendDist\": \"../out\" }  # ../out does not exist -> panic\n\n# after\ntauri.conf.json: \"build\": { \"frontendDist\": \"../dist\", \"beforeBuildCommand\": \"npm run build\" }","handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\ndist=$(jq -r '.build.frontendDist // \"../dist\"' src-tauri/tauri.conf.json)\n[ -d \"src-tauri/$dist\" ] || { echo \"frontendDist '$dist' missing; running frontend build\"; npm run build; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set build.beforeBuildCommand so `tauri build` always produces the frontend first","Assert the dist directory exists as the first CI step after checkout+install","Commit a CI check comparing frontendDist against the bundler's actual output dir"],"tags":["tauri-codegen","frontend-dist","build","config","codegen"],"backgroundTag":"build-output-missing","analyzedSha":"52e4b6e71d8632a7e648f866c442e287ecddee34","analyzedAt":"2026-08-20T13:59:20.734Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}