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

no method named get_window found for mutable reference &mut tauri::App in the current scope #9080

Closed
NoahCodeGG opened this issue Mar 5, 2024 · 3 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@NoahCodeGG
Copy link

Describe the bug

this is my code:

// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

use tauri_plugin_log::{Target, TargetKind};
use tauri::Manager;

fn main() {
  tauri::Builder::default()
    .setup(|app| {
      #[cfg(debug_assertions)]
      {
        let window = app.get_window("main").unwrap();
        window.open_devtools();
      }
      Ok(())
    })
    .plugin(tauri_plugin_fs::init())
    .plugin(tauri_plugin_os::init())
    .plugin(tauri_plugin_persisted_scope::init())
    .plugin(tauri_plugin_shell::init())
    .plugin(tauri_plugin_store::Builder::default().build())
    .plugin(tauri_plugin_websocket::init())
    .plugin(tauri_plugin_log::Builder::new().targets([
      Target::new(TargetKind::Stdout),
      Target::new(TargetKind::LogDir { file_name: None }),
      Target::new(TargetKind::Webview),
    ]).build())
    .run(tauri::generate_context!())
    .expect("error while running tauri application");
}

CleanShot 2024-03-05 at 11 51 46@2x

Reproduction

No response

Expected behavior

No response

Full tauri info output

[✔] Environment
    - OS: Mac OS 14.3.1 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.76.0 (07dca489a 2024-02-04)
    ✔ cargo: 1.76.0 (c84b36747 2024-01-18)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 21.6.2
    - pnpm: 8.15.4
    - yarn: 1.22.21
    - npm: 10.2.4
    - bun: 1.0.30

[-] Packages
    - tauri [RUST]: 2.0.0-beta.8
    - tauri-build [RUST]: 2.0.0-beta.6
    - wry [RUST]: 0.37.0
    - tao [RUST]: 0.26.1
    - @tauri-apps/api [NPM]: 2.0.0-beta.3
    - @tauri-apps/cli [NPM]: 2.0.0-beta.6

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

Stack trace

No response

Additional context

No response

@NoahCodeGG NoahCodeGG added status: needs triage This issue needs to triage, applied to new issues type: bug labels Mar 5, 2024
@FabianLars
Copy link
Member

In v2 it's called get_webview_window() now :)

@FabianLars FabianLars closed this as not planned Won't fix, can't repro, duplicate, stale Mar 5, 2024
@Xiaobaishushu25
Copy link

In v2 it's called get_webview_window() now :)

hello,i find use https://docs.rs/tauri-plugin-window-state/2.0.0-beta.6/tauri_plugin_window_state/index.html must use Window type,but get_webview_window() return type is WebviewWindow, and any method in WebviewWindow to get Window must enable unstable feature,but there is some problem #9634, Is there any solution?

@FabianLars
Copy link
Member

Hmm, that's an issue with the plugin then. It should be implemented to WebviewWindow too... Could you open an issue in the plugins-workspace repo about this? (i'm out of office right now)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

3 participants