diff --git a/.changes/fix-asset-loading-vue-router.md b/.changes/fix-asset-loading-vue-router.md new file mode 100644 index 000000000..c59c745d2 --- /dev/null +++ b/.changes/fix-asset-loading-vue-router.md @@ -0,0 +1,5 @@ +--- +"tauri": patch +--- + +Fallback to `index.html` on asset loading so router with history mode works. diff --git a/core/tauri/src/manager.rs b/core/tauri/src/manager.rs index 070e7df5f..0485046a4 100644 --- a/core/tauri/src/manager.rs +++ b/core/tauri/src/manager.rs @@ -427,6 +427,11 @@ impl WindowManager

{ let asset_response = assets .get(&path) + .or_else(|| { + #[cfg(debug_assertions)] + eprintln!("Asset `{}` not found; fallback to index.html", path); // TODO log::error! + assets.get("index.html") + }) .ok_or(crate::Error::AssetNotFound(path)) .map(Cow::into_owned); match asset_response {