# Dioxus assets in workspace root?

**URL:** <https://users.rust-lang.org/t/dioxus-assets-in-workspace-root/140737>\
**Category:** uncategorized\
**Created:** [June 16, 2026, 3:13am UTC](https://users.rust-lang.org/t/dioxus-assets-in-workspace-root/140737 "2026-06-16T03:13:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcianx](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/marcianx/32/6194_2.png) [@marcianx](https://users.rust-lang.org/u/marcianx)\
**Post date:** [June 16, 2026, 3:13am UTC](https://users.rust-lang.org/t/dioxus-assets-in-workspace-root/140737/1 "2026-06-16T03:13:51Z")

</div>

I'm having trouble finding the right documentation for this.

I have the following structure for a workspace

- `crates`
  - `my_library` \<-- has tests that depend on fonts
  - `my_library_dioxus` \<-- a dioxus web demo for my library

- `fonts` \<-- some `otf`s with their own individual licenses
- `Cargo.toml`

I'm trying to declare `asset!`s within `my_library_dioxus` to include the `fonts` from the workspace, but `assert!` (which is anchored on the crate root) doesn't seem to allow references to `../../fonts/*`. Is there a way to have it reference the contents of `fonts`? Or does it require duplicating the `fonts/` directory within the `my_library_dioxus` crate?

---

<div class="post-metadata">

**Author:** ![jofas](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/jofas/32/30690_2.png) [@jofas](https://users.rust-lang.org/u/jofas)\
**Post date:** [June 16, 2026, 7:46am UTC](https://users.rust-lang.org/t/dioxus-assets-in-workspace-root/140737/2 "2026-06-16T07:46:03Z")

</div>

What is the actual error message? But yes, [looks to me](https://github.com/DioxusLabs/dioxus/blob/main/packages/manganis/manganis-macro/src/lib.rs#L336-L368) like assets can only be in a subdirectory of the manifest dir (where your package's `Cargo.toml` file is) or the output directory (defaults to a `target/` directory in your workspace). A soft link to your assets in `my_library_dioxus` should probably suffice.

---

<div class="post-metadata">

**Author:** ![marcianx](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/marcianx/32/6194_2.png) [@marcianx](https://users.rust-lang.org/u/marcianx)\
**Post date:** [June 16, 2026, 3:54pm UTC](https://users.rust-lang.org/t/dioxus-assets-in-workspace-root/140737/3 "2026-06-16T15:54:36Z")

</div>

I had tried a relative symlink before and it didn't work. Thanks for the suggestion though.

Errors are different for hot-reloading and `dx build`. These are the errors for `dx build --package my_library_dioxus`. Say, the font is at `$workspace_root/fonts/FontFile-Regular.otf`, I get the following messages (copy-pasted with paths replaced).

1. **Relative path:**

2. **Relative path with `/`** :

3. **Symlink:** Creating an `assets/fonts` subdirectory and adding a relative-path symlink:

4. **Real file:** With the same `FONT` definition as (3), replacing the symlink with a copy of the font file makes it succeed.

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/system/32/51372_2.png) [@system](https://users.rust-lang.org/u/system)\
**Post date:** [September 14, 2026, 3:55pm UTC](https://users.rust-lang.org/t/dioxus-assets-in-workspace-root/140737/4 "2026-09-14T15:55:06Z")

</div>

Closed on September 14, 2026, 3:55pm UTC

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.
