Unverified Commit a41e3c10 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Await preloading right before rendering the page (#4896)

parent 05b68916
...@@ -72,8 +72,6 @@ async function doRender (req, res, pathname, query, { ...@@ -72,8 +72,6 @@ async function doRender (req, res, pathname, query, {
require(appPath) require(appPath)
]) ])
await Loadable.preloadAll() // Make sure all dynamic imports are loaded
Component = Component.default || Component Component = Component.default || Component
if (typeof Component !== 'function') { if (typeof Component !== 'function') {
...@@ -143,6 +141,8 @@ async function doRender (req, res, pathname, query, { ...@@ -143,6 +141,8 @@ async function doRender (req, res, pathname, query, {
return { html, head, errorHtml, buildManifest } return { html, head, errorHtml, buildManifest }
} }
await Loadable.preloadAll() // Make sure all dynamic imports are loaded
const docProps = await loadGetInitialProps(Document, { ...ctx, renderPage }) const docProps = await loadGetInitialProps(Document, { ...ctx, renderPage })
const dynamicImports = getDynamicImportBundles(reactLoadableManifest, reactLoadableModules) const dynamicImports = getDynamicImportBundles(reactLoadableManifest, reactLoadableModules)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment