From a5979b181421a1db8750d7523f3ecb1b3158d7a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wiktor=20Tkaczy=C5=84ski?= Date: Sat, 22 Dec 2018 15:28:28 +0100 Subject: [PATCH] fix: don't use EnsureResources for default 404 page --- packages/gatsby/cache-dir/root.js | 34 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/gatsby/cache-dir/root.js b/packages/gatsby/cache-dir/root.js index 530de58b0bf79..8b7c63902a844 100644 --- a/packages/gatsby/cache-dir/root.js +++ b/packages/gatsby/cache-dir/root.js @@ -64,27 +64,27 @@ class RouteHandler extends React.Component { ) } else { const dev404Page = pages.find(p => /^\/dev-404-page\/?$/.test(p.path)) - const custom404 = locationAndPageResources => - loader.getPage(`/404.html`) ? ( - - ) : null + const Dev404Page = syncRequires.components[dev404Page.componentChunkName] + + if (!loader.getPage(`/404.html`)) { + return + } return ( - {locationAndPageResources => - createElement( - syncRequires.components[dev404Page.componentChunkName], - { - pages, - custom404: custom404(locationAndPageResources), - ...this.props, + {locationAndPageResources => ( + } - ) - } + {...this.props} + /> + )} ) }