Skip to content

Commit

Permalink
use partial hydration env in loader
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinjude authored and wardpeet committed Sep 5, 2022
1 parent 85b4ea7 commit da03ff7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/gatsby/cache-dir/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,10 @@ const createComponentUrls = componentChunkName =>
export class ProdLoader extends BaseLoader {
constructor(asyncRequires, matchPaths, pageData) {
const loadComponent = (chunkName, exportType = `components`) => {
if (!global.hasPartialHydration) {
exportType = `components`
}

if (!asyncRequires[exportType][chunkName]) {
throw new Error(
`We couldn't find the correct component chunk with the name "${chunkName}"`
Expand Down

0 comments on commit da03ff7

Please sign in to comment.