navigateTo
doesn't return promise, thus cannot be awaited
#1226
Labels
navigateTo
doesn't return promise, thus cannot be awaited
#1226
Environment
Reproduction
Nuxt Bridge reproduction
https://stackblitz.com/edit/nuxt-bridge-starter-nbqmvf?file=pages%2Findex.vue
Nuxt 3 reproduction
https://stackblitz.com/edit/nuxt-starter-me3k42?file=pages%2Findex.vue
Describe the bug
Utility helper
navigateTo
does not return a promise, thus cannot be awaited.The method
router.push
has the same behaviour. You may notice, that the app crashes onrouter.push('/').then(() => {})
, because there is no.then
inundefined
In this Nuxt Bridge reproduction I have tried to add
await
to thenavigateTo
, and second alert fires synchronously.But in Nuxt 3,
await
makes the difference and second alert fires after navigation complete.A little bit of code
pages/index.vue
pages/todos/index.vue
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: