asyncData not updating data correctly using watchQuery (HMR)

Timkor
6
Timkor
commented 3 months ago

Version

v2.8.1

Reproduction link

https://codesandbox.io/s/codesandbox-nuxt-lfoy3?fontsize=14

Steps to reproduce

Click the Change query randomly to see asyncData working. It will update the current route's query and display this value on the page.

  1. Now change in ~/pages/index.vue:
await new Promise(resolve => setTimeout(resolve, 1000));

to

//await new Promise(resolve => setTimeout(resolve, 1000));
  1. Press save.
  2. Wait until compilation is done.
  3. See that it is broken when clicking the link.
  4. Remove the // comment, so that it's restored back to normal.
  5. Press save.
  6. See that it is still broken.

What is expected ?

asyncData should be called. And the data should be updated with the return value.

What is actually happening?

asyncData is being called. However, the return value is not updating the components data though.

bug
1
dr3tt
0
dr3tt
commented 2 months ago

I tried with a simple console.log('foo') (instead of Promise+setTimeout) and the same issue occurred.
Only a fresh rebuild (i.e. without HMR) makes things work.

0
Timkor
6
Timkor
commented a month ago

Bump

0
papakay
0
papakay
commented a month ago

Also experiencing this issue…

0
Informations
Bug ReportOpen
#c9432 - Created 3 months ago