Description
Version
2.6.7
Reproduction link
https://codesandbox.io/s/239l9qnkxn
Steps to reproduce
- Open https://codesandbox.io/s/239l9qnkxn
- Immediately (before the async component is resolved within 7 sec) click on the "Some Page" link
- Click on the "Home" link (before 7s are elapsed)
What is expected?
The AsyncReady component should render after 7 seconds.
What is actually happening?
The AsyncLoading component is shown forever
The problem is that the currentRenderingInstance
is Home
. After rendering the SomePage
route, the initial Home
instance (which is stored as the owner
of the factory) is destroyed. As soon as the factory calls forceRender
, triggering $forceUpdate()
on the owner does nothing because the old Home
instance already was destroyed and a new one was created when navigating back to Home
.
This is problematic on very slow connections when users click a link before all dynamic components were resolved or in case of automatic redirects which are triggered immediately after a page is loaded (after checking auth for example).
See: https://github.com/vuejs/vue/blob/dev/src/core/vdom/helpers/resolve-async-component.js#L58-L74