{"record":{"id":"35d09362c1ab9ed2","repo":"gatsbyjs/gatsby","slug":"gatsby-plugin-page-creator-12107","errorCode":"gatsby-plugin-page-creator_12107","errorMessage":"\"path\" is a required option for gatsby-plugin-page-creator\n\nSee docs here - https://www.gatsbyjs.com/plugins/gatsby-plugin-page-creator/","messagePattern":"\"path\" is a required option for gatsby-plugin-page-creator\n\nSee docs here - https://www\\.gatsbyjs\\.com/plugins/gatsby-plugin-page-creator/","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-plugin-page-creator/src/gatsby-node.ts","lineNumber":76,"sourceCode":"  },\n  pluginOptions: IOptions,\n  doneCb: PluginCallback\n): Promise<void> {\n  const {\n    path: pagesPath,\n    pathCheck = true,\n    ignore,\n    slugify: slugifyOptions,\n  } = pluginOptions\n  try {\n    const { deletePage } = actions\n    const { program, config } = store.getState()\n    const { trailingSlash = `always` } = config\n\n    const exts = program.extensions.map(e => `${e.slice(1)}`).join(`,`)\n\n    if (!pagesPath) {\n      reporter.panic({\n        id: prefixId(CODES.RequiredPath),\n        context: {\n          sourceMessage: `\"path\" is a required option for gatsby-plugin-page-creator\n\nSee docs here - https://www.gatsbyjs.com/plugins/gatsby-plugin-page-creator/`,\n        },\n      })\n    }\n\n    // Validate that the path exists.\n    if (pathCheck && !existsSync(pagesPath)) {\n      reporter.panic({\n        id: prefixId(CODES.NonExistingPath),\n        context: {\n          sourceMessage: `The path passed to gatsby-plugin-page-creator does not exist on your file system:\n\n${pagesPath}\n","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/packages/gatsby-plugin-page-creator/src/gatsby-node.ts#L58-L94","documentation":"In gatsby-node.ts:74-84, the page-creator plugin destructures pluginOptions and checks if pagesPath is falsy. If the 'path' option was not provided (or is empty/null/undefined), reporter.panic fires with id prefixId(CODES.RequiredPath). The path option tells the plugin which directory to scan for page components (JSX/TSX/MDX files) — without it, the plugin has nothing to operate on.","triggerScenarios":"Registering gatsby-plugin-page-creator in gatsby-config.js without a 'path' option, or with path: '' / path: null / path: undefined. Using the object form { resolve: 'gatsby-plugin-page-creator' } without an options object at all.","commonSituations":"Copy-paste from docs that omitted the path option. Renaming the pages directory without updating config. Plugin configuration typo (e.g. paths instead of path).","solutions":["Add the path option pointing to your pages directory: options: { path: `${__dirname}/src/pages` }","Ensure the path value is a non-empty string","Verify the options object is correctly nested under the plugin's resolve entry"],"exampleFix":"// before (gatsby-config.js)\n{\n  resolve: `gatsby-plugin-page-creator`,\n  // no options provided\n},\n\n// after\n{\n  resolve: `gatsby-plugin-page-creator`,\n  options: {\n    path: `${__dirname}/src/pages`,\n  },\n},","handlingStrategy":"validation","validationCode":"// Validate gatsby-config.js plugin options before build\nconst pageCreatorPlugin = plugins.find(\n  p => (typeof p === 'string' ? p : p.resolve) === 'gatsby-plugin-page-creator'\n)\nif (pageCreatorPlugin && typeof pageCreatorPlugin === 'object') {\n  if (!pageCreatorPlugin.options?.path) {\n    throw new Error('gatsby-plugin-page-creator requires a \"path\" option')\n  }\n}","typeGuard":"function hasValidPath(\n  options: unknown\n): options is { path: string } {\n  return (\n    typeof options === 'object' &&\n    options !== null &&\n    'path' in options &&\n    typeof (options as { path: unknown }).path === 'string' &&\n    (options as { path: string }).path.length > 0\n  )\n}","tryCatchPattern":null,"preventionTips":["Always specify the path option when registering gatsby-plugin-page-creator","Use a config validation step before running gatsby build/develop","Use template literals with __dirname for robust path references"],"tags":["configuration","gatsby-plugin","validation","page-creator"],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}