#Newbie rust compiling issues - use of unresolved module or unlinked crate `dioxus`

1 messages · Page 1 of 1 (latest)

outer grotto
#

Okay I am going crazy, I added log = "0.4" to my cargo dependencies, and all of a sudden my project blew up 🙁
Cargo.toml

[package]
name = "project"
version = "0.1.0"

[dependencies]
dioxus = { version = "0.6.0", features = [] }
log = "0.4"

[features]
default = ["mobile"]
web = ["dioxus/web"]
desktop = ["dioxus/desktop"]
mobile = ["dioxus/mobile"]
# ...

main.rs

use dioxus::prelude::*;
// ...
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `dioxus`
 --> src/main.rs:3:5
  |
3 | use dioxus::prelude::*;
  |     ^^^^^^ use of unresolved module or unlinked crate `dioxus`
  |
help: if you wanted to use a crate named `dioxus`, use `cargo add dioxus` to add it to your `Cargo.toml` and import it in your code
  |
3 + extern crate dioxus;
  |

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `dioxus`
 --> src/components/hero.rs:1:5
  |
1 | use dioxus::prelude::*;
  |     ^^^^^^ use of unresolved module or unlinked crate `dioxus`
  |

What on earth is going on here? 🙁 just my luck for trying to do this before doing my initial commit, I was just tidying things up and now no amount of undo's fixes anything. I tried cargo clean but cargo build and dx serve is still causing issues...

#

Note: this happened when I added the log dependency while dx serve was running, and it caused a fresh rebuild and then started giving these errors

modern helm
#

Maybe try deleting your entire target directory?

#

Not sure if cargo clean deletes dioxus's artefacts

outer grotto
#

oh gosh i completely missed that.. It's building again lets see what happens this time (i know this isn't a dx issue its probably just me getting stressed and not remembering rust quirks)

#

hmm, its still giving me errors. I guess i could start over maybe.

I'll try recloning this exact commit to see if it's some sort of state in this folder just for good measure i guess

#

okay even a complete reclone is causing this..

14:37:16 [cargo] error[E0433]: failed to resolve: use of unresolved module or unlinked crate dioxus
--> src/main.rs:3:5
|
3 | use dioxus::prelude::*;
| ^^^^^^ use of unresolved module or unlinked crate dioxus

i guess i'll try just a fresh dioxus project..?

#

okay, so a fresh project has built.. hm

outer grotto
#

okay its a Cargo.lock error. I guess now I've learned although this only really happened because i was trying to tidy up my initial commit and my playing around corrupted it. Sorry for the post!