diff --git a/.changes/core-asset-fallback.md b/.changes/core-asset-fallback.md new file mode 100644 index 000000000..2a3da7765 --- /dev/null +++ b/.changes/core-asset-fallback.md @@ -0,0 +1,5 @@ +--- +"tauri": patch +--- + +Assets will now fallback to `/index.html` before `/index.html`, allowing anchor links to work as expected. diff --git a/core/tauri/src/manager.rs b/core/tauri/src/manager.rs index 0c953b3b9..0c6b4277d 100644 --- a/core/tauri/src/manager.rs +++ b/core/tauri/src/manager.rs @@ -353,6 +353,7 @@ impl WindowManager { let asset_response = assets .get(&path.as_str().into()) + .or_else(|| assets.get(&format!("{}/index.html", path.as_str()).into())) .or_else(|| { #[cfg(debug_assertions)] eprintln!("Asset `{}` not found; fallback to index.html", path); // TODO log::error!