nuxt / nuxt

The Intuitive Vue Framework.
https://nuxt.com
MIT License
54.92k stars 5.02k forks source link

error.vue useSeoMeta with i18n is missing reactivity #21677

Closed tomsdob closed 1 year ago

tomsdob commented 1 year ago

Environment


Reproduction

https://stackblitz.com/edit/github-nmhzwq-lxngab?file=pages%2Findex.vue

Describe the bug

Switching locale in /error.vue updates the text inside of <template>, but does not update the title with useSeoMeta() if useFetch()/useAsyncData() inside the /pages/index.vue page are used asynchronously.

Additional context

Can see the title of the website not changing by clicking on "Open in New Tab" on StackBlitz and clicking on locale links while using await useAsyncData or await useFetch in /pages/index.vue.

Logs

No response

danielroe commented 1 year ago

cc: @harlan-zw

harlan-zw commented 1 year ago

Can confirm there is a bug.

I spent some time playing with this, I tested the general reactivity of useSeoMeta within error.vue and it seemed to work correctly.

I tested the general reactivity of the i18n locale and that seemed to work correctly.

Combining both of them seems to cause the issue so will need to investigate further. Good to leave with me.

harlan-zw commented 1 year ago

I think the reproduction is stale. Anyway this may be fixed with latest Nuxt and Unhead 1.4

danielroe commented 1 year ago

Yes, it doesn't look the the reproduction exists any more (for this issue). Let's close as I think this was solved; if you are still experiencing this, please provide a reproduction and we'll reopen. 🙏

tomsdob commented 1 year ago

@harlan-zw, @danielroe Sorry, something had happened with the reproduction. I updated it to match the issue: https://stackblitz.com/edit/github-nmhzwq-lxngab?file=pages%2Findex.vue Open the app in a new tab to see the title not changing when switching locales and then after commenting out useAsyncData in pages/index.vue, the title changes when switching locales.

danielroe commented 1 year ago

resolved in https://github.com/nuxt/nuxt/pull/22945