{"record":{"id":"cd462c9169970e81","repo":"gatsbyjs/gatsby","slug":"11323","errorCode":"11323","errorMessage":"${pluginName} must set the page path when creating a page.\\n\\nThe page object passed to createPage:\\n${pageObject}","messagePattern":"(.+?) must set the page path when creating a page\\.\\\\n\\\\nThe page object passed to createPage:\\\\n(.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby/src/redux/actions/public.js","lineNumber":198,"sourceCode":" *   context: {\n *     id: `123456`,\n *   },\n * })\n */\nactions.createPage = (\n  page: IPageInput,\n  plugin?: Plugin,\n  actionOptions?: ActionOptions\n) => {\n  let name = `The plugin \"${plugin.name}\"`\n  if (plugin.name === `default-site-plugin`) {\n    name = `Your site's \"gatsby-node.js\"`\n  }\n  if (!page.path) {\n    const message = `${name} must set the page path when creating a page`\n    // Don't log out when testing\n    if (isNotTestEnv) {\n      report.panic({\n        id: `11323`,\n        context: {\n          pluginName: name,\n          pageObject: page,\n          message,\n        },\n      })\n    } else {\n      return message\n    }\n  }\n\n  // Validate that the context object doesn't overlap with any core page fields\n  // as this will cause trouble when running graphql queries.\n  if (page.context && typeof page.context === `object`) {\n    const invalidFields = reservedFields.filter(field => field in page.context)\n\n    if (invalidFields.length > 0) {","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/packages/gatsby/src/redux/actions/public.js#L180-L216","documentation":"Thrown by Gatsby's createPage action when the page object has no `path` field (falsy). The action builds a human-readable plugin name ('Your site's gatsby-node.js' for the default plugin, else 'The plugin \"<name>\"'), then panics with code 11323, including the offending page object so the user can see what was passed.","triggerScenarios":"A call to actions.createPage({ ... }) where `path` is undefined, empty, or omitted; the !page.path check fires.","commonSituations":"Building pages from a data source and forgetting to set path; a typo (e.g. `paths` instead of `path`); a slug/title field that was null in the source data and was assigned to path.","solutions":["Ensure every createPage call sets a non-empty `path` string, typically `path: `/${node.slug}/``.","Filter or default source data so the value used for path is never null/undefined.","Use the pageObject printed in the panic to find the offending node and the call site that produced it."],"exampleFix":"// before\ncreatePage({ component, context: { id } /* path missing */ })\n// after\ncreatePage({ path: `/post/${node.slug}/`, component, context: { id } })","handlingStrategy":"validation","validationCode":"// Validate before calling createPage\nif (!page.path || typeof page.path !== 'string') {\n  throw new Error(`createPage needs a non-empty path string; got ${page.path}`)\n}\nactions.createPage(page)","typeGuard":"// Type guard for a createPage payload\nfunction hasValidPath(p): p is { path: string } {\n  return typeof p?.path === 'string' && p.path.length > 0\n}","tryCatchPattern":null,"preventionTips":["Always set path explicitly; derive it from a guaranteed non-null source field.","Filter source nodes whose slug/title is null before generating paths.","Add a unit test asserting every createPage call sets path."],"tags":["pages","createpage","validation","action"],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}