Subscribe on changes!

Keep-alive tag with Router is causing an internal error

avatar
Oct 17th 2022

Vue version

3.2.41

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-sn8nws?file=src/App.vue

Steps to reproduce

first npm run serve then switch between the 2 views "Home" and "All Data" repeatedly in the navbar

What is expected?

it is expected for the components to be cached when deactivated an reloaded correctly when activated

What is actually happening?

It's throwing an error "Uncaught (in promise) TypeError: Node.insertBefore: Argument 1 is not an object." when switching views and freezing

System Info

No response

Any additional comments?

This kind of setup with keep-alive and vue-router is the only one I could find on the web that is not deprecated, so I don't know if other configurations (if available) might work.

avatar
Oct 17th 2022

close as duplicate.

avatar
Oct 17th 2022

@davidfarah2003 You can use a div as the root element in the component.

Example.