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] Panic when doing basic global-shortcut setup #12961

Open
scottyantipa opened this issue Mar 12, 2025 · 0 comments
Open

[bug] Panic when doing basic global-shortcut setup #12961

scottyantipa opened this issue Mar 12, 2025 · 0 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@scottyantipa
Copy link

Describe the bug

Im trying to get the global-shortcut plugin to work. I've started a new minimal tauri v2 app using sh <(curl https://create.tauri.app/sh) and followed the linked instructions above to try to get a basic setup where I can register shortcut events in Rust. I'm getting the stacktrace (below).

I have noticed that if I do the javascript setup instead I can get the events to trigger in JS, but this isnt my use case (I need global access eg even if the window is closed). So I want to respond from Rust.

Reproduction

Setup a new app with sh <(curl https://create.tauri.app/sh).

Follow instructions from: https://v2.tauri.app/plugin/global-shortcut/. I used the Rust "automatic" setup instructions. Then edited permissions, etc.

Run tauri yarn dev.

Expected behavior

No response

Full tauri info output

[✔] Environment
    - OS: Mac OS 15.3.1 arm64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.84.1 (e71f9a9a9 2025-01-27)
    ✔ cargo: 1.84.1 (66221abde 2024-11-19)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (environment override by RUSTUP_TOOLCHAIN)
    - node: 20.0.0
    - pnpm: 10.6.2
    - yarn: 1.22.22
    - npm: 9.6.4

[-] Packages
    - tauri 🦀: 2.3.1
    - tauri-build 🦀: 2.0.6
    - wry 🦀: 0.50.4
    - tao 🦀: 0.32.8
    - tauri-cli 🦀: 2.3.1
    - @tauri-apps/api : 2.3.0
    - @tauri-apps/cli : 2.3.1

[-] Plugins
    - tauri-plugin-global-shortcut 🦀: 2.2.0
    - @tauri-apps/plugin-global-shortcut : 2.2.0
    - tauri-plugin-opener 🦀: 2.2.6
    - @tauri-apps/plugin-opener : 2.2.6

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

Stack trace

$ yarn tauri dev
yarn run v1.22.22
$ tauri dev
    Running BeforeDevCommand (`yarn dev`)
$ vite

  VITE v6.2.1  ready in 98 ms

  ➜  Local:   http://localhost:1420/
    Running DevCommand (`cargo  run --no-default-features --color always --`)
    Info Watching /Users/antipa/code/rust-projects/test-global-shortcuts-hello-world/src-tauri for changes...
   Compiling test-global-shortcuts-hello-world v0.1.0 (/Users/antipa/code/rust-projects/test-global-shortcuts-hello-world/src-tauri)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 8.78s
     Running `target/debug/test-global-shortcuts-hello-world`
thread 'main' panicked at /Users/antipa/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tauri-2.3.1/src/app.rs:1078:11:
Failed to setup app: error encountered during setup hook: failed to initialize plugin `global-shortcut`: No such file or directory (os error 2)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at core/src/panicking.rs:223:5:
panic in a function that cannot unwind
stack backtrace:
   0:        0x10141fa4c - std::backtrace_rs::backtrace::libunwind::trace::h4965e0a7b4ac11d7
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
   1:        0x10141fa4c - std::backtrace_rs::backtrace::trace_unsynchronized::hf4fa2da75bbd5d09
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:        0x10141fa4c - std::sys::backtrace::_print_fmt::h75773692a17404c8
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/sys/backtrace.rs:66:9
   3:        0x10141fa4c - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h39ba3129e355bb22
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/sys/backtrace.rs:39:26
   4:        0x10143d85c - core::fmt::rt::Argument::fmt::h34f25d464889fcc7
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/core/src/fmt/rt.rs:177:76
   5:        0x10143d85c - core::fmt::write::h8b50d3a0f616451a
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/core/src/fmt/mod.rs:1189:21
   6:        0x10141cef0 - std::io::Write::write_fmt::h4b3bbae7048e35f8
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/io/mod.rs:1884:15
   7:        0x10141f900 - std::sys::backtrace::BacktraceLock::print::h7934b1e389160086
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/sys/backtrace.rs:42:9
   8:        0x10142084c - std::panicking::default_hook::{{closure}}::hbcd636b20f603d1e
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:268:22
   9:        0x101420680 - std::panicking::default_hook::ha9081970ba26bc6c
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:295:9
  10:        0x10142103c - std::panicking::rust_panic_with_hook::h9a5dc30b684e2ff4
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:801:13
  11:        0x101420c8c - std::panicking::begin_panic_handler::{{closure}}::hbcb5de8b840ae91c
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:667:13
  12:        0x10141ff10 - std::sys::backtrace::__rust_end_short_backtrace::ha657d4b4d65dc993
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/sys/backtrace.rs:170:18
  13:        0x10142096c - rust_begin_unwind
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:665:5
  14:        0x101462854 - core::panicking::panic_nounwind_fmt::runtime::h13e8a6e8075ea543
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/core/src/panicking.rs:119:22
  15:        0x101462854 - core::panicking::panic_nounwind_fmt::h4a10ecea0e21f67a
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/core/src/intrinsics/mod.rs:3535:9
  16:        0x1014628cc - core::panicking::panic_nounwind::ha9a59379b5f3f41a
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/core/src/panicking.rs:223:5
  17:        0x101462a44 - core::panicking::panic_cannot_unwind::h1bb1158913507f0a
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/core/src/panicking.rs:315:5
  18:        0x1011033ac - tao::platform_impl::platform::app_delegate::did_finish_launching::h76f7bb5d3c3b7a8e
                               at /Users/antipa/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tao-0.32.8/src/platform_impl/macos/app_delegate.rs:114:1
  19:        0x19d349370 - <unknown>
  20:        0x19d3da20c - <unknown>
  21:        0x19d3da154 - <unknown>
  22:        0x19d317fac - <unknown>
  23:        0x19e4d26b8 - <unknown>
  24:        0x1a0ed348c - <unknown>
  25:        0x1a0ed323c - <unknown>
  26:        0x1a0ed169c - <unknown>
  27:        0x1a0ed12a4 - <unknown>
  28:        0x19e4fb4ac - <unknown>
  29:        0x19e4fb2a4 - <unknown>
thread caused non-unwinding panic. aborting.
✨  Done in 14.67s.

Additional context

No response

@scottyantipa scottyantipa added status: needs triage This issue needs to triage, applied to new issues type: bug labels Mar 12, 2025
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

1 participant