fix: fail to load latest module in ssr (#123)

* fix: fail to load latest module in server env

* chore: update desc
This commit is contained in:
luhc228 2022-04-14 21:13:28 +08:00 committed by ClarkXia
parent 8f4f79dae5
commit a37b09a321
1 changed files with 4 additions and 1 deletions

View File

@ -12,7 +12,10 @@ type RouteModule = Pick<RouteItem, 'id' | 'load'>;
export async function loadRouteModule(route: RouteModule) {
const { id, load } = route;
if (id in routeModules) {
if (
typeof window !== 'undefined' && // Don't use module cache and should load again in ssr. Ref: https://github.com/ice-lab/ice-next/issues/82
id in routeModules
) {
return routeModules[id];
}