tauri-apps / tauri

Build smaller, faster, and more secure desktop and mobile applications with a web frontend.
https://tauri.app
Apache License 2.0
83.64k stars 2.51k forks source link

[bug] No method named `iter` found in `src/manager.rs` #8322

Closed knownasnaffy closed 10 months ago

knownasnaffy commented 10 months ago

Describe the bug

Build fails due to error[E0599] on windows

error[E0599]: no method named `iter` found for struct `Arc<(dyn Assets + 'static)>` in the current scope
   --> C:\Users\naffy\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tauri-1.5.3\src\manager.rs:640:23
    |
640 |     self.inner.assets.iter()
    |                       ^^^^ method not found in `Arc<dyn Assets>`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `tauri` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...
       Error failed to build app: failed to build app
ELIFECYCLE  Command failed with exit code 1.

Reproduction

Expected behavior

Build should run successfully.

Platform and versions

[✔] Environment
    - OS: Windows 10.0.20348 X64
    ✔ WebView2: 105.0.1343.27
    ✔ MSVC: Visual Studio Enterprise 2022
    ✔ rustc: 1.74.0 (79e9716c9 2023-11-13)
    ✔ cargo: 1.74.0 (ecb9851af 2023-10-18)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 18.18.2
    - pnpm: 8.11.0
    - yarn: 1.22.21
    - npm: 9.8.1

[-] Packages
    - tauri [RUST]: 1.5.2
    - tauri-build [RUST]: 1.5.0
    - wry [RUST]: 0.24.4
    - tao [RUST]: 0.16.5
    - @tauri-apps/api [NPM]: 1.5.1
    - @tauri-apps/cli [NPM]: 1.5.6

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:5173/
    - framework: React
    - bundler: Vite

Stack trace

No response

Additional context

Reverting the version back to 1.5.2 fixes the problem

amrbashir commented 10 months ago

Try running cargo update inside src-tauti

knownasnaffy commented 10 months ago

Try running cargo update inside src-tauri*

It works. Thank you! May I know the reason it was acting that way?

amrbashir commented 10 months ago

with the newly released version it depended on a new version of tauri-utils but for some reason your tauri version was updated but not tauri-utils

knownasnaffy commented 10 months ago

Okay, thanks.

newfla commented 10 months ago

Hi @amrbashir I'm having the same issue with depandabot. Due to tauri 1.5.3 relying on Assets::iter b3e53e72(#8288) introduced in tauri-utils 1.5.1, should tauri-utils dependency declared in core/tauri be bumped to 1.5.1? That will be translated as >=1.5.1 according to cargo-book Can I open a pull request?

FabianLars commented 10 months ago

I agree, we should rely on that more often to prevent issues like these. I think it's hard to automate with covector though 🤔 => PR would be appreciated, though i do wonder if covector will overwrite it on the next tauri-utils update.

cc @lucasfernog and @jbolda (my knowledge about covector is ~0)