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
Compile error for async stateful commands that don't return a Result
#2533
Labels
Comments
This comment has been minimized.
This comment has been minimized.
Is there any interim solution? |
For now you just have to return a Result. If you don't want to return anything from the command it can be as simple as This doesn't change what you'll receive on the JavaScript side. Ok will resolve the Promise and Err will reject it. |
Pascal-So
added a commit
to Pascal-So/tauri
that referenced
this issue
Jan 22, 2023
Async commands currently have to return `Result` due to the way they are mapped to JS promises. Once issue tauri-apps#2533 is resolved, this commit can be reverted.
13 tasks
Pascal-So
added a commit
to Pascal-So/tauri
that referenced
this issue
Jan 22, 2023
Async commands that contain references in their arguments currently have to return `Result`. Once issue tauri-apps#2533 is resolved, this commit can be reverted.
Pascal-So
added a commit
to Pascal-So/tauri
that referenced
this issue
Apr 18, 2023
Async commands that contain references in their arguments currently have to return `Result`. Once issue tauri-apps#2533 is resolved, this commit can be reverted.
Pascal-So
added a commit
to Pascal-So/tauri
that referenced
this issue
Apr 18, 2023
Async commands that contain references in their arguments currently have to return `Result`. Once issue tauri-apps#2533 is resolved, this commit can be reverted.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Stateful async commands that don't return a
Result
give a compiler error.To Reproduce
Example:
There's no error if you remove
async
, remove theapp
argument, or change the return type to aResult
works.Platform and Versions
Details
Stack Trace
The text was updated successfully, but these errors were encountered: