fix: fail to render document when csr (#428)

* fix: fail to render document when csr

* chore: merge release-next

* chore: line break
This commit is contained in:
luhc228 2022-08-10 14:40:07 +08:00 committed by ClarkXia
parent 1d71d83e51
commit 26f8bf7b67
1 changed files with 3 additions and 2 deletions

View File

@ -160,11 +160,12 @@ async function doRender(serverContext: ServerContext, renderOptions: RenderOptio
}
const routePath = getCurrentRoutePath(matches);
const routeModules = await loadRouteModules(matches.map(({ route: { id, load } }) => ({ id, load })));
if (documentOnly) {
return renderDocument({ matches, routePath, renderOptions, routeModules });
return renderDocument({ matches, routePath, renderOptions, routeModules: {} });
}
// FIXME: https://github.com/ice-lab/ice-next/issues/427
const routeModules = await loadRouteModules(matches.map(({ route: { id, load } }) => ({ id, load })));
try {
return await renderServerEntry({