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

[bug] Error plugin window not found when using appWindow with @tauri-apps/plugin-window #7542

Closed
luucasrb opened this issue Aug 2, 2023 · 2 comments
Labels
status: needs more info Issue needs more information, discussion or reproducible example status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@luucasrb
Copy link

luucasrb commented Aug 2, 2023

Describe the bug

Before the 2.0.0-alpha.9 it was working fine with:

import { appWindow, PhysicalPosition, PhysicalSize } from '@tauri-apps/api/window';

const position: PhysicalPosition = await appWindow.innerPosition();
const size: PhysicalSize = await appWindow.innerSize();

However, since the changes made at #6947, I cannot use the methods innerPosition() and innerSize() anymore with:

import { appWindow, PhysicalPosition, PhysicalSize } from '@tauri-apps/plugin-window';

const position: PhysicalPosition = await appWindow.innerPosition();
const size: PhysicalSize = await appWindow.innerSize();

The error message returned is Unhandled Promise Rejection: plugin window not found.

Reproduction

  • Change @tauri-apps/api to @tauri-apps/plugin-window
  • Try to use innerPosition and innerSize methods

Expected behavior

No response

Platform and versions

Rust:

[✔] Environment
    - OS: Ubuntu 22.04 X64
    ✔ webkit2gtk-4.1: 2.40.4
    ✔ rsvg2: 2.52.5
    ✔ rustc: 1.70.0 (90c541806 2023-05-31)
    ✔ Cargo: 1.70.0 (ec8a8a0ca 2023-04-25)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
    - node: 16.17.0
    - yarn: 1.22.19
    - npm: 8.19.4

[-] Packages
    - tauri [RUST]: 2.0.0-alpha.9
    - tauri-build [RUST]: 2.0.0-alpha.5
    - wry [RUST]: 0.28.3
    - tao [RUST]: 0.19.1
    - @tauri-apps/api [NPM]: not installed!
    - @tauri-apps/cli [NPM]: 2.0.0-alpha.9

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: http://127.0.0.1:1189/
    - devPath: http://127.0.0.1:1189/

TypeScript:

"@tauri-apps/api": "2.0.0-alpha.5"
"@tauri-apps/plugin-clipboard-manager": "2.0.0-alpha.0"
"@tauri-apps/plugin-window": "^2.0.0-alpha.0"
"@tauri-apps/cli": "2.0.0-alpha.9"

Stack trace

No response

Additional context

No response

@luucasrb luucasrb added status: needs triage This issue needs to triage, applied to new issues type: bug labels Aug 2, 2023
@amrbashir
Copy link
Member

did you also add the plugin in Cargo.toml and in main.rs?

@amrbashir amrbashir added the status: needs more info Issue needs more information, discussion or reproducible example label Aug 2, 2023
@luucasrb
Copy link
Author

luucasrb commented Aug 2, 2023

did you also add the plugin in Cargo.toml and in main.rs?

Thanks,

Cargo.toml

tauri-plugin-window = "2.0.0-alpha"

main.rs

  .plugin(tauri_plugin_window::init())

Solved it.

@amrbashir amrbashir closed this as not planned Won't fix, can't repro, duplicate, stale Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs more info Issue needs more information, discussion or reproducible example status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

2 participants