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] [macOS] Emit works on 2.0.0-beta.4 but breaks in 2.0.0-beta.8 #9052

Closed
venkr opened this issue Mar 1, 2024 · 4 comments
Closed

[bug] [macOS] Emit works on 2.0.0-beta.4 but breaks in 2.0.0-beta.8 #9052

venkr opened this issue Mar 1, 2024 · 4 comments
Labels
priority: 1 high status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@venkr
Copy link

venkr commented Mar 1, 2024

Describe the bug

We're unable to listen to receive emit events in built apps from a Webview beyond 2.0.0-beta.4. Specifically, we've got a working project with the following dependencies in the .lock:
tauri: 2.0.0-beta.4
"tauri-build": 2.0.-beta.3

A change that runs cargo update, and does the relevant capabilities.json change (moving local & remote into context) makes this no longer work on the following version:
tauri: 2.0.0-beta.8
"tauri-build": 2.0.-beta.6

The event is being sent to Any and listened globally via JS, via emit and listen. This is all re: macOS.

Reproduction

No response

Expected behavior

No response

Full tauri info output

[✔] Environment
    - OS: Mac OS 13.5.0 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: 20.10.0
    - pnpm: 8.11.0
    - yarn: 1.22.19
    - npm: 10.2.3

[-] Packages
    - tauri [RUST]: 2.0.0-beta.4
    - tauri-build [RUST]: 2.0.0-beta.3
    - wry [RUST]: 0.36.0
    - tao [RUST]: 0.26.0
    - @tauri-apps/api [NPM]: 2.0.0-beta.0
    - @tauri-apps/cli [NPM]: 2.0.0-beta.3

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

Stack trace

No response

Additional context

No response

@venkr venkr added status: needs triage This issue needs to triage, applied to new issues type: bug labels Mar 1, 2024
@martpie
Copy link

martpie commented Mar 4, 2024

I have faced this issue today as well and solved it using import { listen } from '@tauri-apps/api/event';.

But indeed, getCurrent().listen(...) seems to not be working.

@venkr
Copy link
Author

venkr commented Mar 4, 2024

I have faced this issue today as well and solved it using import { listen } from '@tauri-apps/api/event';.

But indeed, getCurrent().listen(...) seems to not be working.

Interesting - we've always used import { listen, UnlistenFn } from '@tauri-apps/api/event' + await listen()
So it looks like what worked for you somehow still broke for us 🤔

@amrbashir
Copy link
Member

could you share a minimal repro?

@martpie martpie mentioned this issue Mar 17, 2024
78 tasks
@venkr
Copy link
Author

venkr commented Mar 18, 2024

I'm no longer able to repro this in Tauri 2.0.0-beta.11

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

No branches or pull requests

4 participants