Skip to content

Link asset never loaded If re-rendered too quickly #5142

@mcmah309

Description

@mcmah309

Problem

I ran into a possible race condition that keeps link assets from being loaded. Even though there are no errors in the web or local console.

I created a replication here https://github.com/mcmah309/dioxus_link_bug

Even if you attempt to make changes to the local css file that was never loaded in the first place, the console says the "file is being hot reloaded", but the file still does not exist in sources in chrome dev tools.

For my real world case that ran into the bug, there is actual async work inside the resource. But it happens with an empty resource as well.

Note: The title of the issue is "Link asset never loaded If re-rendered too quickly" but I have no idea if this is actually the reason for the bug, but it seems like the likely culprit.

Steps To Reproduce

Run the example above dx serve --platform web

Expected behavior

The background of the screen should be blue and asset main1.css should be loaded. But the asset is not loaded.

Environment:

  • Dioxus version: 0.7.2
  • Rust version: 1.93.0-nightly
  • OS info: Linux
  • App platform: web

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions