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
useAsyncData
clears out nested route data before leaving
#13814
Comments
Works without provide/inject StackBlitz. |
Yes, the issue is happening, when |
This looks like it might be the same issue as vuejs/core#5513. |
@danielroe https://stackblitz.com/edit/github-kcptvx?file=app.vue same thing is happening, even without provide/inject, when the route is dynamically nested Try going through |
Experiencing the same problem |
Is the problem being solved? Or should I start inventing crutches? |
The route-based data issue is resolved and is no longer reproducible, so I'm going to close this. Note that if you are using |
@danielroe The problem is still there. Before route changes, it clears the page. It shouldn't be that way. Screen.Recording.2022-09-14.at.12.58.07.mov |
@danielroe Please take a look a this Screen.Recording.2022-09-16.at.14.54.59.mov |
You should not share a key between the pages. Set it to |
@danielroe I updated the keys, but nothing has changed.. Try out yourself, please. |
@danielroe I think the problem is more deeper than asyncData itself. It's the way that Nuxt handles pages. Instead of loading one by one async page component, it should wait for all nested async pages to be loaded to fully show, like Nuxt2 does it. |
msedge_eW8BVcEJpZ.mp4Not sure if this is the same issue, but I seem to experience something similar. Reproduction; https://stackblitz.com/edit/github-f4gpfk-m2cxo3?file=app.vue |
@Luffyyy Yes, as I said previously, it's the way that Nuxt handles async pages. It loads the root route component and then one by one loads the subroute component. Nuxt should wait until all nested pages is loaded before displaying everything. |
I have the same problem. @mvrlin did you find any workaround for this? |
Unfortunately, no :( |
Could this be the base for a solution @mvrlin , @danielroe ? Based on the suspense feature? I'm pretty sure it's related to how Nuxt handles page changes - vuejs/core#6736 This is a pretty important feature for modular websites these days, to have your asyncData data linked to a specific sub route - you see Instagram case on Settings, Youtube, Bitbucket, Grafana etc.. |
For some reason this pull was downgraded from important to minor when it is definitely not a minor bug, it makes nested pages undesirable. It seems to also sit without any updates. I really hope it gets pushed soon otherwise I'm gonna have to get rid of all of the nested routes. |
@Luffyyy I saw Atinux post on the twitter using the But I have no clue how to use the result from data outside the |
It would be helpful to have some more information about how page transitions are done with Nuxt engine so a temporary solution can be arranged - even if depends on the open PR from Vue3 - this way one could prepare the base ground with a fork and help to ease the mind of people wanting to continue using Nuxt with Vue tooling. |
Such an important problem has not been solved in a year, and there is not even a temporary fix. Probably have to say goodbye to nuxt |
I'm sorry you feel that way. As you see, it is an upstream bug which we have created a PR to fix, but it depends on Vue itself merging it. |
@danielroe How long do you think it will take to solve this problem? Week, month, year? |
@champ7champ Whenever the linked PR will be merged, which is not in our hands. |
The patch doesn't work. Maybe the problem is not only with |
Once that PR is merged, we then have to update Nuxt's implementation to use the prop it adds. |
Whoops, good point 🙈 |
This comment was marked as off-topic.
This comment was marked as off-topic.
The implementation will be pretty much instant on the Nuxt end 😆 The best thing you can do is not comment on this issue as it pings everyone who is subscribed. |
I patched the Vue with |
Activity is falling, the problem is moving further and further away, or is something being solved there? |
@danielroe This still happens in the latest build, is this intended behavior? where you leave the route and the child gets detached first while the parent isn't? It just looks plain weird. Updated repro: https://stackblitz.com/edit/github-f4gpfk-qhgrfy?file=pages/test.vue |
It's definitely not intended behaviour, but I think it's also different from the original issue here. I've opened a new issue to keep track of it. |
Environment
Darwin
v16.14.2
3.0.0-rc.1
pnpm@6.32.8
vite
build
,buildModules
,components
,css
,srcDir
,typescript
,vite
,server
-
@intlify/nuxt3@0.1.10
,@pinia/nuxt@0.1.8
,nuxt-windicss@2.3.1
Reproduction
https://stackblitz.com/edit/github-ypbf5b?file=app.vue
To reproduce the issue, load the website with the url
/users/foo
and click Go HomeDescribe the bug
useAsyncData
clears out nested route data before leaving. If the next route is still loading, it produces a blank page, which isn't great 😢 Maybe it is due to provide/inject.Additional context
Untitled.mov
Logs
No response
The text was updated successfully, but these errors were encountered: