JonasKruckenberg / tauri-sys

Bindings to the Tauri API for projects using wasm-bindgen
Apache License 2.0
84 stars 21 forks source link

process::exit not working: RuntimeError: Unreachable code should not be executed #44

Closed kzhui125 closed 5 months ago

kzhui125 commented 5 months ago
use leptos::*;
use tauri_sys::process;

spawn_local(async move {
    process::exit(1).await;
})
image
JonasKruckenberg commented 5 months ago

Without any context like this it's hard to pin down what's going on, but have you configured your allowlist to allow the process module and exit function?

kzhui125 commented 5 months ago

After change tauri.conf.json and Cargo.toml, it works.

Thanks, but I think the error message is confusing.

"process": {
    "all": true
}
"process-all"
JonasKruckenberg commented 5 months ago

Yeah agreed, tbf though you should be getting a second error message from Tauri telling you what's wrong, but maybe we can improve this error message too

kzhui125 commented 5 months ago

Yeah agreed, tbf though you should be getting a second error message from Tauri telling you what's wrong, but maybe we can improve this error message too

How can I get second error message from Tauri? I only get error from frontend dev tools now.

code:

temp1.zip