#can't find macros crate in Tauri 2.0

15 messages · Page 1 of 1 (latest)

pliant jay
#

I keep getting this error:

error[E0463]: can't find crate for `tauri_macros`
  --> /home/hunter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tauri-2.1.1/src/menu/mod.rs:71:9
   |
71 |       #[tauri_macros::default_runtime(crate::Wry, wry)]
   |         ^^^^^^^^^^^^ can't find crate

error[E0463]: can't find crate for `tauri_macros`
   --> /home/hunter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tauri-2.1.1/src/lib.rs:377:3
    |
377 | #[tauri_macros::default_runtime(Wry, wry)]
    |   ^^^^^^^^^^^^ can't find crate

I have this in my Cargo.toml:

[build-dependencies]
tauri-build = { version = "2", features = [] }

[dependencies]
tauri = { version = "2.1.1", features = ["wry"] }
tauri-macros = { version = "2" }
#

Nevermind, I think I'm just doing things wrong. Gonna git stash and try again.

pliant jay
#

I'm still running into this issue:

error[E0463]: can't find crate for tauri_macros

Only thing I'm adding to a fresh create tauri app is the theme plugin, which I'm invoking here:

+    spawn_local(async move {
+        let theme_args = serde_wasm_bindgen::to_value(&serde_json::json!({
+            "theme": "auto"
+        }))
+        .unwrap();
+        invoke("plugin:theme|set_theme", theme_args).await;
+    });

And I'm building here:

#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
    let mut ctx = tauri::generate_context!();

    tauri::Builder::default()
        .plugin(tauri_plugin_shell::init())
        .plugin(tauri_plugin_theme::init(ctx.config_mut()))
        .invoke_handler(tauri::generate_handler![greet])
        .run(ctx)
        .expect("error while running tauri application");
}

It's very strange I'm getting this error, since I'm obviously using tauri macros...

#

<@&1115985763423748227> Can we get this put back to unsolved? ferrisPray

tulip raptor
#

please only ping the mods for stuff like spam reports

#

can you share the output of the tauri info command?

#

also, try deleting the ~/.cargo/registry/ and the project's target/ folders and try again.

pliant jay
#

Sorry about that

[✔] Environment
    - OS: Garuda Linux Soaring x86_64 (X64)
    ✔ webkit2gtk-4.1: 2.46.4
    ✔ rsvg2: 2.59.2
    ✔ rustc: 1.82.0 (f6e511eec 2024-10-15)
    ✔ cargo: 1.82.0 (8f40fc59f 2024-08-21)
    ✔ rustup: 1.27.1 (2024-05-07)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (environment override by RUSTUP_TOOLCHAIN)
    - node: 23.1.0
    - yarn: 1.22.22
    - npm: 10.9.0
    - bun: 1.1.36

[-] Packages
    - tauri 🦀: 2.1.1
    - tauri-build 🦀: 2.0.3
    - wry 🦀: 0.47.2
    - tao 🦀: 0.30.8
    - tauri-cli 🦀: 2.1.0

[-] Plugins
    - tauri-plugin-shell 🦀: 2.0.2

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/

I realized I was running an outdated version of tauri-cli, that might've been causing problems

I also deleted the cargo registry and ran cargo clean and after building again it worked like a charm

Thank you so much, and apologies for the inconvenience I caused

tulip raptor
#

i really wonder why the registry breaks so often lately. what's the cargo team doing kkushKEKW