I should clarify that I have already found a workaround for this, but it’s behaving in a way that I feel is incorrect, and seeing no one else complain about this makes me feel like maybe something is set up incorrectly.
This project is using webpack. I have one router in my application. The view models on my routes each have a promise that fetches data from my server in the Activate() method. If the route loads from a fresh site load (f5) the router will delay the rendering of the entire application, even assets outside of the <router-view>
. It’s just a blank white page while pending load.
activate(params, routeConfig, navInstruction: NavigationInstruction) {
if (!navInstruction.previousInstruction) {
this.getMyData();
return;
}
return new Promise(resolve => {
this.getMyData()
.then(() => {
resolve();
});
});
}
You can see that I “fixed” this by checking for a previous route and handling things different if there is none. If you take that code away, the problem described above happens.