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

Errors thrown in the asynchronous callback function in watch will not be caught. #749

Closed
ygj6 opened this issue Jul 7, 2021 · 0 comments · Fixed by #751
Closed

Errors thrown in the asynchronous callback function in watch will not be caught. #749

ygj6 opened this issue Jul 7, 2021 · 0 comments · Fixed by #751

Comments

@ygj6
Copy link
Member

ygj6 commented Jul 7, 2021

Version: 1.0.0-rc.13

The reproduced demo is: https://codesandbox.io/s/tngl5

After executing npm run serve, the console will display as follows, then the error will not be caught

image

The main code is as follows:

Vue.config.errorHandler = (err) => {
  console.log("catch the error:");
  console.log(err);
};

setup(){
  const obj = reactive({a:11})
  watch(
    () => obj.a,
    async() => {
      throw new Error("111");
    },
    { immediate: true}
  );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant