DioxusLabs / DioxusLabs/dioxus
Fullstack server build fails when hotpatching assets
- Dominant language
- Rust
- Stars
- 39.1k
- Forks
- 1.9k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 4
Description
**Problem**
when any part of the application is using the `asset` macro, hot patching any changes fails for the server build. WASM client has no issues. Desktop builds fail completely.
**Steps To Reproduce**
Steps to reproduce the behavior:
- Create a fullstack project and import something with asset macro, e.g: `static IMAGE: Asset = asset!("/assets/image.png"); `, add it the the component so it's used somewhere
- run the `dx serve --hot-patch`, wait for the appllicaton to build
- Change anything that causes hot patching. Server build will fail with this error:
```
14:21:10 [dev] Failed to generate patch: ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol '__MANGANIS__5e2ce531361920f6'; recompile with -fPIC
>>> defined in /home/sebba/work/izvir/client/target/x86_64-unknown-linux-gnu/server-dev/deps/client-111e53aa4e6535a1.e71p5bx3z5roz4s65ypqmtw1d.0mu9e5e.rcgu.o
>>> referenced by main.rs:29 (src/main.rs:29)
>>> /home/sebba/work/izvir/client/target/x86_64-unknown-linux-gnu/server-dev/deps/client-111e53aa4e6535a1.e71p5bx3z5roz4s65ypqmtw1d.0mu9e5e.rcgu.o:(client::App::h5a73ecfc9df81926)
ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol '__MANGANIS__adf434fb1f797c25'; recompile with -fPIC
>>> defined in /home/sebba/work/izvir/client/target/x86_64-unknown-linux-gnu/server-dev/deps/client-111e53aa4e6535a1.e71p5bx3z5roz4s65ypqmtw1d.0mu9e5e.rcgu.o
>>> referenced by main.rs:29 (src/main.rs:29)
>>> /home/sebba/work/izvir/client/target/x86_64-unknown-linux-gnu/server-dev/deps/client-111e53aa4e6535a1.e71p5bx3z5roz4s65ypqmtw1d.0mu9e5e.rcgu.o:(client::App::h5a73ecfc9df81926)
collect2: error: ld returned 1 exit status
14:21:10 [dev] Build failed: I/O Error: No such file or directory (os error 2)
```
**Expected behavior**
Asset is linked correctly
**Environment:**
- Dioxus version: main
- Rust version: rustc 1.89.0-nightly (99e7c15e8 2025-06-01)
- OS info: Arch linux
- App platform: web, desktop
**Questionnaire**
I'm interested in fixing this myself but don't know where to start.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.