-
Notifications
You must be signed in to change notification settings - Fork 175
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
[Nuxt3] Async data called twice #44
Comments
Can be tracked here now; I also added another a reproduction |
Related to vuejs/core#5513 |
This should be fixed in latest Nuxt. However, you may notice that setup is still running twice (as this is caused by upstream bug) linked by @atinux. If you encounter this, you can work around for now by enabling keepalive on the parent: <script setup>
definePageMeta({
keepalive: true
})
</script> |
@danielroe Just tried the latest version of nuxt, the |
Yes, that would be the upstream bug. Have you tried with the workaround I mentioned? If it doesn't work, I can see if I can find another workaround for you. |
I did try to add the |
It only works in pages, and it only needs to be set in the parent page which has a child with |
Do you have |
I have access to the repo but it's not setup with env variables or backend. |
Would you rather have the full .env so you could run the API with docker or have a reproduction link with Stackblitz for example? |
I can reproduce the issue, but can resolve it with my workaround above. I need to see why it's not working for Nuxt.com specifically. If you can repro it not working in stackblitz even with my workaround, that would be ideal. Otherwise, the full .env would be perfect. |
An easier way would be to clone |
Sounds good 👍 How can I reproduce the issue then? |
Awesome! You can go to http://localhost:3000/@danielroe/projects and see that the |
When using
useAsyncData
, the http call is made on server and on client.The text was updated successfully, but these errors were encountered: