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

Unhandled rejection / error in Vue 3 #25

Open
MartinMalinda opened this issue Oct 21, 2020 · 0 comments
Open

Unhandled rejection / error in Vue 3 #25

MartinMalinda opened this issue Oct 21, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@MartinMalinda
Copy link
Owner

MartinMalinda commented Oct 21, 2020

Vue 3 seems to be even more careful about unhandled rejections than Vue 2. Due to the nature of the tasks, where you sometimes you do things like

await task.perform();
if (!task.isError) {

}

This can be annoying.

Or maybe even when the perform function is passed directly in the template:

@submit="saveTask.perform"

It seems like Vue 3 is checking if the result is thenable and then check if the promise rejection is handled. But this internal Vue code makes the task think it's being "awaited" and it makes the task to throw. It's a catch 22.

[Vue warn]: Unhandled error during execution of component event handler ...

There was a way to prevent this in Vue 2, I'll see if if it's possible in Vue 3 too.

@MartinMalinda MartinMalinda changed the title Unhandled rejection in Vue 3 Unhandled rejection / error in Vue 3 Oct 21, 2020
@MartinMalinda MartinMalinda added the bug Something isn't working label Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant