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

Symlinked assets regression #3422

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

Symlinked assets regression #3422

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

Comments

@Andrew15-5
Copy link
Contributor

Problem

Because of #3410, I had to make a full copy of the project in an adjacent directory, where everything is symlinked to ../original-project/, except for Cargo.toml and now with v0.6.1 — tailwind.css (actually all explicitly used assets). I'm pretty sure it's because Dioxus checks fully resolved absolute path, which is indeed outside of the checked crate, so it gives this:

13:08:21 [dev] Full rebuild: triggered manually
13:08:22 [cargo] error: Asset path /path/to/project/assets/favicon.ico is invalid. Make sure the asset exists within this crate
  --> src/main.rs:28:24
   |
28 | const FAVICON: Asset = asset!("/assets/favicon.ico");
   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this error originates in the macro `asset` (in Nightly builds, run with -Z macro-backtrace for more info

13:08:22 [cargo] error: Asset path /path/to/project/assets/styling/main.css is invalid. Make sure the asset exists within this crate
  --> src/main.rs:29:25
   |
29 | const MAIN_CSS: Asset = asset!("/assets/styling/main.css");
   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this error originates in the macro `asset` (in Nightly builds, run with -Z macro-backtrace for more info

13:08:22 [cargo] error: Asset path /path/to/project/assets/styling/tailwind.css is invalid. Make sure the asset exists within this crate
  --> src/main.rs:30:29
   |
30 | const TAILWIND_CSS: Asset = asset!("/assets/styling/tailwind.css");
   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this error originates in the macro `asset` (in Nightly builds, run with -Z macro-backtrace for more info

13:08:23 [cargo] error: could not compile `desktop` (bin "desktop") due to 3 previous errors; 2 warnings emitted

Steps To Reproduce

Steps to reproduce the behavior:

  • dx new test
  • mkdir test-copy
  • fd -d 1 -E target '' test -X ln -sr '{}' test-copy
  • cd test-copy
  • dx serve

Expected behavior

I used this project with v0.6.0 and didn't have such issues.

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: desktop

Questionnaire

I'm interested in fixing this myself but don't know where to start.
I would like to fix and I think have a solution.
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