{"record":{"id":"84915a3d53f8a202","repo":"gatsbyjs/gatsby","slug":"not-a-valid-pagedata-response","errorCode":null,"errorMessage":"not a valid pageData response","messagePattern":"not a valid pageData response","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/gatsby/cache-dir/loader.js","lineNumber":182,"sourceCode":"  }\n\n  setApiRunner(apiRunner) {\n    this.apiRunner = apiRunner\n    this.prefetchDisabled = apiRunner(`disableCorePrefetching`).some(a => a)\n  }\n\n  fetchPageDataJson(loadObj) {\n    const { pagePath, retries = 0 } = loadObj\n    const url = createPageDataUrl(pagePath)\n    return this.memoizedGet(url).then(req => {\n      const { status, responseText } = req\n\n      // Handle 200\n      if (status === 200) {\n        try {\n          const jsonPayload = JSON.parse(responseText)\n          if (jsonPayload.path === undefined) {\n            throw new Error(`not a valid pageData response`)\n          }\n\n          const maybeSearch = pagePath.split(`?`)[1]\n          if (maybeSearch && !jsonPayload.path.includes(maybeSearch)) {\n            jsonPayload.path += `?${maybeSearch}`\n          }\n\n          return Object.assign(loadObj, {\n            status: PageResourceStatus.Success,\n            payload: jsonPayload,\n          })\n        } catch (err) {\n          // continue regardless of error\n        }\n      }\n\n      // Handle 404\n      if (status === 404 || status === 200) {","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby/cache-dir/loader.js#L164-L200","documentation":"Client-side page-data loader: the 200 response for page-data.json parsed as JSON but had no 'path' key, so it is not the expected pageData payload shape — typically a dev server returning HTML or an error document where JSON was expected.","triggerScenarios":"Thrown at packages/gatsby/cache-dir/loader.js:182 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Hard-refresh to bust a stale cached page-data response","Clear .cache/public and restart the dev server","Check the dev server log for the actual response served for that page path"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e85d62f1779e353eaac1753211629a26d123e26c","analyzedAt":"2026-08-26T17:50:09.662Z","contentChangedAt":"2026-08-26T17:50:09.662Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}