-
Notifications
You must be signed in to change notification settings - Fork 137
Closed
Description
> cargo create-tauri-app
✔ Project name · tauri-app
✔ Identifier · com.tauri-app.tauri-app
✔ Choose which language to use for your frontend · Rust - (cargo)
✔ Choose your UI template · Dioxus - (https://dioxuslabs.com/)
Template created! To get started run:
cd tauri-app
cargo tauri android init
For Desktop development, run:
cargo tauri dev
For Android development, run:
cargo tauri android dev
When generating a Tauri project with the Dioxus frontend template and running cargo tauri dev, the application fails to load assets (CSS, icons, etc.) from the assets/ directory. This results in broken styles and missing icons, as shown in the screenshot below:
The current template uses path strings directly to reference assets. However, per Dioxus’ Styling and Assets documentation, assets should be loaded via the asset!() macro.
Here's a simple diff demonstrating the fix:
+static CSS: Asset = asset!("/assets/styles.css");
rsx! {
- link { rel: "stylesheet", href: "styles.css" }
+ link { rel: "stylesheet", href: CSS }
/* ... */
}Metadata
Metadata
Assignees
Labels
No labels
