{"record":{"id":"fbe3fc6a36cd4bcf","repo":"tauri-apps/tauri","slug":"unable-to-find-your-web-assets-did-you-forget-to","errorCode":null,"errorMessage":"Unable to find your web assets, did you forget to build your web app? Your frontendDist is set to \"{}\" (which is `{}`).","messagePattern":"Unable to find your web assets, did you forget to build your web app\\? Your frontendDist is set to \"(.+?)\" \\(which is `(.+?)`\\)\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-cli/src/build.rs","lineNumber":219,"sourceCode":"\n  if let Some(before_build) = config.build.before_build_command.clone() {\n    helpers::run_hook(\n      \"beforeBuildCommand\",\n      before_build,\n      interface,\n      options.debug,\n      dirs.frontend,\n    )?;\n  }\n\n  if let Some(FrontendDist::Directory(web_asset_path)) = &config.build.frontend_dist {\n    if !web_asset_path.exists() {\n      let absolute_path = web_asset_path\n        .parent()\n        .and_then(|p| p.canonicalize().ok())\n        .map(|p| p.join(web_asset_path.file_name().unwrap()))\n        .unwrap_or_else(|| std::env::current_dir().unwrap().join(web_asset_path));\n      crate::error::bail!(\n        \"Unable to find your web assets, did you forget to build your web app? Your frontendDist is set to \\\"{}\\\" (which is `{}`).\",\n        web_asset_path.display(), absolute_path.display(),\n      );\n    }\n    if web_asset_path\n      .canonicalize()\n      .fs_context(\"failed to canonicalize path\", web_asset_path.to_path_buf())?\n      .file_name()\n      == Some(std::ffi::OsStr::new(\"src-tauri\"))\n    {\n      crate::error::bail!(\n          \"The configured frontendDist is the `src-tauri` folder. Please isolate your web assets on a separate folder and update `tauri.conf.json > build > frontendDist`.\",\n        );\n    }\n\n    // Issue #13287 - Allow the use of target dir inside frontendDist/distDir\n    // https://github.com/tauri-apps/tauri/issues/13287\n    let target_path = get_cargo_target_dir(&options.args, dirs.tauri)?;","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/tauri-apps/tauri/blob/52e4b6e71d8632a7e648f866c442e287ecddee34/crates/tauri-cli/src/build.rs#L201-L237","documentation":"When `build.frontendDist` is a directory, the CLI checks that it exists before bundling. A missing directory almost always means the frontend build that should produce it never ran — typically because `beforeBuildCommand` is unset, misconfigured, or points at the wrong script.","triggerScenarios":"`tauri build` (or `tauri dev`) with `\"frontendDist\": \"../dist\"` when `dist/` does not exist: the frontend was never built, `beforeBuildCommand` is missing/misspelled in `tauri.conf.json`, or the frontend bundler outputs to a different directory.","commonSituations":"First build after scaffolding without a `beforeBuildCommand`; custom bundlers (vite/webpack) writing to `build/` while the config says `dist/`; CI caching that excludes the frontend output; running `tauri build` directly inside `src-tauri` with a relative `frontendDist` that resolves differently.","solutions":["Build the frontend manually once (`npm run build` in the frontend dir) and confirm the output folder matches `frontendDist`","Set `beforeBuildCommand` in `tauri.conf.json` to your frontend build script (e.g. `\"beforeBuildCommand\": \"npm run build\"`) so the CLI builds it for you","Correct the `frontendDist` path if your bundler emits elsewhere (e.g. `../build` instead of `../dist`)"],"exampleFix":"// before (tauri.conf.json)\n\"build\": { \"frontendDist\": \"../dist\" }   // and no beforeBuildCommand\n\n// after\n\"build\": {\n  \"beforeBuildCommand\": \"npm run build\",\n  \"frontendDist\": \"../dist\"\n}","handlingStrategy":"validation","validationCode":"# verify frontendDist exists before building\nDIST=$(jq -r '.build.frontendDist' src-tauri/tauri.conf.json)\n[ -d \"src-tauri/$DIST\" ] || { echo \"frontendDist $DIST missing — run the frontend build first\" >&2; exit 1; }\ntauri build","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set `beforeBuildCommand` so the CLI builds the frontend itself","Confirm your bundler's output dir matches `frontendDist` after changing bundler config","In CI, cache or run the frontend build explicitly before `tauri build`"],"tags":["tauri-cli","config","frontend","build","static-assets"],"backgroundTag":"missing-build-output","analyzedSha":"52e4b6e71d8632a7e648f866c442e287ecddee34","analyzedAt":"2026-08-20T13:59:20.734Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}