diff --git a/packages/gatsby/cache-dir/loader.js b/packages/gatsby/cache-dir/loader.js index 4a6941948c837..6fd5e9b6799bb 100644 --- a/packages/gatsby/cache-dir/loader.js +++ b/packages/gatsby/cache-dir/loader.js @@ -243,7 +243,7 @@ const queue = { const pageResources = { component: syncRequires.components[page.componentChunkName], json: syncRequires.json[page.jsonName], - layout: syncRequires.layouts[page.layoutComponentChunkName], + layout: syncRequires.layouts[page.layout], page, } cb(pageResources) @@ -308,7 +308,7 @@ const queue = { }) page.layoutComponentChunkName && - getResourceModule(page.layoutComponentChunkName, (err, l) => { + getResourceModule(page.layout, (err, l) => { if (err) { console.log(`Loading the Layout for ${page.path} failed`) } diff --git a/packages/gatsby/cache-dir/static-entry.js b/packages/gatsby/cache-dir/static-entry.js index 6888bf6d339e9..1df41d1581b41 100644 --- a/packages/gatsby/cache-dir/static-entry.js +++ b/packages/gatsby/cache-dir/static-entry.js @@ -33,7 +33,7 @@ const getPage = path => pages.find(page => page.path === path) const defaultLayout = props =>