-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
this.$nuxt.refresh
doesn't refresh every fetch
hooks (^2.12.0)
#9439
Comments
ps: https://github.com/nuxt/nuxt.js/blob/HEAD/packages/vue-app/template/App.js#L185, does this mean that if you have a |
Thanks for your contribution to Nuxt!
Issues that are labeled as |
We are approaching the Nuxt 2 EOL date (June 30, 2024) - see this article for more information. This is advance warning that I'm going to close this issue then, as it's currently marked as a Nuxt 2 related bug. If it's a critical or security issue, please do comment and let me know, in case it is possible to address it before the EOL date. If it's a an issue you think is relevant for Nuxt 3, please feel free to open a fresh issue (or just comment here so I can update labels, etc.). 🙏 Thank you for your understanding and for your contribution to Nuxt. ❤️ |
It's the day, at last. Nuxt 2 is now marked end-of-life. My apologies we never got round to resolving this bug in the 2.x branch, but we do have to draw a line somewhere. Again, if you think this is still relevant for Nuxt going forward, please feel free to open a fresh issue (or just comment here so I can update labels, etc.). 🙏 |
Hey friends 👋
Versions
Reproduction
Steps to reproduce
1. Create
~/components/AppHeader.vue
, a component that uses thefetch
hook2. Update your
~/layouts/default.vue
file to use your new fancy header3. Build your application and start it in production
yarn generate && yarn start
4. Fiddle with the Nuxt refresh button
What is expected?
Displayed timestamp in header should be refreshed/updated.
What is actually happening?
Displayed timestamp in header remains the same.
Context
When Nuxt refresh is called here's what happen regarding the
fetch
hook feature (vulgarized):Using our previous example, this leads to
this.$nuxt.refresh
successfully refreshing thosefetch
hooks:And as you can see, our app header's hook is left ignored 😢
Looking at the code in charge of that (https://github.com/nuxt/nuxt.js/blob/HEAD/packages/vue-app/template/App.js#L180-L193), we can clearly see that the "crawling components looking for
fetch
hooks" part starts from the page, not the layout, leading to the described-above issue.Voilà! Let me know if anything, cheers~
The text was updated successfully, but these errors were encountered: