{"record":{"id":"4c0e214be90d2b68","repo":"gatsbyjs/gatsby","slug":"11322","errorCode":"11322","errorMessage":"${pluginName} created a page and didn't pass the path to the component.\\n\\nThe page object passed to createPage:\\n${input}","messagePattern":"(.+?) created a page and didn't pass the path to the component\\.\\\\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":268,"sourceCode":"        report.panic({\n          id: `11324`,\n          context: {\n            message: error,\n          },\n        })\n      } else {\n        if (!hasWarnedForPageComponentInvalidContext.has(page.component)) {\n          report.warn(error)\n          hasWarnedForPageComponentInvalidContext.add(page.component)\n        }\n      }\n    }\n  }\n\n  // Check if a component is set.\n  if (!page.component) {\n    if (isNotTestEnv) {\n      report.panic({\n        id: `11322`,\n        context: {\n          input: page,\n          pluginName: name,\n        },\n      })\n    } else {\n      // For test\n      return `A component must be set when creating a page`\n    }\n  }\n\n  const pageComponentPath = shadowCreatePagePath(page.component)\n  if (pageComponentPath) {\n    page.component = pageComponentPath\n  }\n\n  const { config, program } = store.getState()","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/packages/gatsby/src/redux/actions/public.js#L250-L286","documentation":"Thrown by createPage when the page object has no `component` field (falsy). Code 11322. Every page must reference a component; omitting it panics with the offending input and the plugin name.","triggerScenarios":"A createPage call where `component` is undefined, null, or empty string; the !page.component check fires after the path/context checks.","commonSituations":"Dynamic import returning undefined assigned to component; typo (`Component` vs `component`); a templatePath variable that resolved to undefined; building pages conditionally and forgetting the component branch.","solutions":["Ensure every createPage call passes an absolute path string in `component`, typically `path.resolve(`./src/templates/post.js`)`.","Verify the variable holding the component path is assigned before createPage runs.","Use the printed `input` object in the panic to identify which page lacked a component."],"exampleFix":"// before\ncreatePage({ path: `/p/`, context: { id } /* component missing */ })\n// after\nconst postTemplate = path.resolve(`./src/templates/post.js`)\ncreatePage({ path: `/p/`, component: postTemplate, context: { id } })","handlingStrategy":"validation","validationCode":"if (!page.component || typeof page.component !== 'string') {\n  throw new Error('createPage requires a component path string')\n}\nactions.createPage(page)","typeGuard":"function hasComponent(p): p is { component: string } {\n  return typeof p?.component === 'string' && p.component.length > 0\n}","tryCatchPattern":null,"preventionTips":["Always pass an absolute component path (path.resolve).","Confirm the variable holding the template path is defined before createPage.","Cover createPage calls with tests asserting component is set."],"tags":["pages","createpage","component","validation"],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}