Skip to content

Unhandled rejection / error in Vue 3Β #25

@MartinMalinda

Description

@MartinMalinda

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions