{"record":{"id":"b21de1f09317e2f0","repo":"gatsbyjs/gatsby","slug":"gatsby-plugin-page-creator-12108","errorCode":"gatsby-plugin-page-creator_12108","errorMessage":"The path passed to gatsby-plugin-page-creator does not exist on your file system:\n\n${pagesPath}\n\nPlease pick a path to an existing directory.","messagePattern":"The path passed to gatsby-plugin-page-creator does not exist on your file system:\n\n(.+?)\n\nPlease pick a path to an existing directory\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-plugin-page-creator/src/gatsby-node.ts","lineNumber":88,"sourceCode":"    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\nPlease pick a path to an existing directory.`,\n        },\n      })\n    }\n\n    const pagesDirectory = systemPath.resolve(process.cwd(), pagesPath)\n    const pagesGlob = `**/*.{${exts}}`\n\n    // Get initial list of files.\n    const files = await glob(pagesGlob, { cwd: pagesPath })\n    files.forEach(file => {\n      createPage(","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/packages/gatsby-plugin-page-creator/src/gatsby-node.ts#L70-L106","documentation":"In gatsby-node.ts:87-97, after confirming pagesPath is truthy, the plugin checks if pathCheck is true (default) AND the directory does not exist via !existsSync(pagesPath). If the resolved path doesn't correspond to a real directory on disk, reporter.panic fires with id CODES.NonExistingPath. The path is resolved relative to process.cwd() at line 99.","triggerScenarios":"Providing a path option that points to a non-existent directory. Typo in the path string. Wrong relative path (path is resolved relative to cwd, not __dirname of gatsby-config). Directory was deleted or never created.","commonSituations":"Path typo (e.g. 'src/page' instead of 'src/pages'). Using a relative path that resolves differently than expected. Referencing a directory that hasn't been created yet. Moving project files without updating config.","solutions":["Verify the directory exists: ls -la <your-path>","Use an absolute path via __dirname: path: `${__dirname}/src/pages`","Create the missing directory if needed: mkdir -p src/pages","Set pathCheck: false only if you intentionally want to skip existence validation (not recommended)"],"exampleFix":"// before\noptions: { path: `./src/page` } // typo — directory doesn't exist\n\n// after\noptions: { path: `${__dirname}/src/pages` }","handlingStrategy":"validation","validationCode":"const fs = require('fs')\nconst path = require('path')\n\nconst pagesPath = path.resolve(process.cwd(), options.path)\nif (!fs.existsSync(pagesPath)) {\n  throw new Error(`Directory does not exist: ${pagesPath}`)\n}\nif (!fs.statSync(pagesPath).isDirectory()) {\n  throw new Error(`Path is not a directory: ${pagesPath}`)\n}","typeGuard":"import fs from 'fs'\nimport path from 'path'\n\nfunction isValidPagesDirectory(p: string): boolean {\n  const resolved = path.resolve(process.cwd(), p)\n  return fs.existsSync(resolved) && fs.statSync(resolved).isDirectory()\n}","tryCatchPattern":null,"preventionTips":["Use absolute paths (path.resolve or __dirname) in plugin options","Run a pre-build script that validates all configured paths exist","Create required directories as part of project scaffolding"],"tags":["configuration","filesystem","validation","page-creator"],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}