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

The error thrown in async effect is not passed to the app.config.errorHandler #3127

Closed
foyzhao opened this issue Jan 30, 2021 · 1 comment · Fixed by #3129
Closed

The error thrown in async effect is not passed to the app.config.errorHandler #3127

foyzhao opened this issue Jan 30, 2021 · 1 comment · Fixed by #3129
Labels
🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. 🐞 bug Something isn't working

Comments

@foyzhao
Copy link

foyzhao commented Jan 30, 2021

Version

3.0.5

Reproduction link

https://codepen.io/foyzhao/pen/OJbJYWV

Steps to reproduce

import { createApp, ref, watch, watchEffect } from 'vue'

const app = createApp({
  setup() {
    const count = ref(1)

    watch(count, () => {
      throw new Error('error1')
    }, { immediate: true })

    watch(count, async () => {
      throw new Error('error2')
    }, { immediate: true })

    watchEffect(() => {
      throw new Error('error3')
    })

    watchEffect(async () => {
      throw new Error('error4')
    })
  }
})

app.config.errorHandler = (err) => {
  console.log(err)
}

app.mount('#app')

What is expected?

Error 1~4 should all be passed to app.config.errorHandler

What is actually happening?

Error 4 was not passed to app.config.errorHandler

@edison1105
Copy link
Member

edison1105 commented Jan 30, 2021

@HcySunYang HcySunYang added 🐞 bug Something isn't working 🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. labels Jan 30, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Oct 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. 🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants