Skip to content
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

keep alive caches are destroyed when visit keep alive excluded page #27401

Open
Bananamilk452 opened this issue May 30, 2024 · 3 comments
Open

Comments

@Bananamilk452
Copy link

Bananamilk452 commented May 30, 2024

Environment

"nuxt": "^3.11.2"

Reproduction

https://stackblitz.com/edit/nuxt-starter-fzarr5

  1. Visit A Page and type something. go back,
  2. Visit B Page and type something. go back.
  3. Visit A, B Page. cache works nice.
  4. But after visit C Page, Page A, B caches are gone.

Describe the bug

keep alive caches are destroyed when visit keep alive excluded page

Additional context

No response

Logs

No response

Copy link

stackblitz bot commented May 30, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@danielroe
Copy link
Member

This would be a behaviour change, but it's probably worth it to rethink how we pass options to <Keepalive> so this doesn't happen.

@DeveloperMindset123
Copy link

Hello, I installed and ran the codebase locally on my end to see what was going on, as there was some issues with the stackBlitz section, leading to errors. For which I have attached a screenshot of the terminal output not allowing me to run the code on stack blitz:

image

Note that this issue doesn't persist if I run it locally.

I did play around with the code to better understand what's going on. I believe that this is simply the nature of KeepAlive so that there's a mechanism to reset the cache once it is no longer needed, the issue of cache not being destroyed can be easily resolved by removing it from the exclude array that has been specified. Additionally, I have found the following two links which may help answer your question.

https://vuejs.org/guide/built-ins/keep-alive# --> vuejs documentation to keepAlive
#14609 --> Github PR Issue that is most similar to this problem 2 years ago.

My apologies if I couldn't be of more help to you on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants