Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unused asset! causes an error #3431

Open
Andrew15-5 opened this issue Dec 22, 2024 · 0 comments
Open

Unused asset! causes an error #3431

Andrew15-5 opened this issue Dec 22, 2024 · 0 comments

Comments

@Andrew15-5
Copy link
Contributor

Problem

19:35:05 [dev] Hotreloading: /src/main.rs
19:35:05 [web] %cERROR%c ~/.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/dioxus-core-0.6.1/src/hotreload_utils.rs:192%c Expected a string component property, because the type was &str. The CLI gave the hot reloading engine a type of None. This is probably caused by a bug in dioxus hot reloading. Please report this issue
const FAVICON: Asset = asset!("/assets/favicon.ico");
const MAIN_CSS: Asset = asset!("/assets/styling/main.css");
const TAILWIND_CSS: Asset = asset!("/assets/styling/tailwind.css");

fn main() {
    dioxus::launch(App);
}

#[component]
fn App() -> Element {
    rsx! {
        document::Link { rel: "icon", href: FAVICON }
        document::Link { rel: "stylesheet", href: TAILWIND_CSS }
        // document::Link { rel: "stylesheet", href: MAIN_CSS }
        Navbar {}
    }
}

I am not allowed to have defined assets and not use them.

Steps To Reproduce

Steps to reproduce the behavior:

  • add const asset
  • don't use it
  • serve the web

Expected behavior

No errors.

Screenshots

Environment:

  • Dioxus version: v0.6.1
  • Rust version: rustc 1.83.0-nightly (fb4aebddd 2024-09-30)
  • OS info: Pop!_OS 22.04
  • App platform: web + fullstack

Questionnaire

I'm interested in fixing this myself but don't know where to start.
I don't have time to fix this right now, but maybe later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant