gatsbyjs/gatsby · error

The path passed to gatsby-source-filesystem does not exist

Error message

The path passed to gatsby-source-filesystem does not exist on your file system:
${pluginOptions.path}
Please pick a path to an existing directory.
See docs here - https://www.gatsbyjs.com/plugins/gatsby-source-filesystem/
      

What it means

Error " The path passed to gatsby-source-filesystem does not exist on your file system: ${pluginOptions.path} Please pick a path to an existing directory. See docs here - https://www.gatsbyjs.com/plugins/gatsby-source-filesystem/ " thrown in gatsbyjs/gatsby.

Source

Thrown at packages/gatsby-source-filesystem/src/gatsby-node.js:183

  return interpret(fsMachine).start()
}

exports.pluginOptionsSchema = ({ Joi }) =>
  Joi.object({
    name: Joi.string(),
    path: Joi.string(),
    fastHash: Joi.boolean().default(false),
    ignore: Joi.array().items(
      Joi.string(),
      Joi.object().regex(),
      Joi.function()
    ),
  })

exports.sourceNodes = (api, pluginOptions) => {
  // Validate that the path exists.
  if (!fs.existsSync(pluginOptions.path)) {
    api.reporter.panic(`
The path passed to gatsby-source-filesystem does not exist on your file system:
${pluginOptions.path}
Please pick a path to an existing directory.
See docs here - https://www.gatsbyjs.com/plugins/gatsby-source-filesystem/
      `)
  }

  // Validate that the path is absolute.
  // Absolute paths are required to resolve images correctly.
  if (!path.isAbsolute(pluginOptions.path)) {
    pluginOptions.path = path.resolve(process.cwd(), pluginOptions.path)
  }

  const fsMachine = createFSMachine(api, pluginOptions)

  // Once bootstrap is finished, we only let one File node update go through
  // the system at a time.
  api.emitter.on(`BOOTSTRAP_FINISHED`, () => {

View on GitHub (pinned to 8b06340921)

Solutions

  1. Fix the path option for gatsby-source-filesystem in gatsby-config.js to point at an existing directory.
  2. Create the missing directory, or use path.resolve(__dirname, 'relative/path') so the path is absolute and correct.

When it happens

Trigger: Thrown at packages/gatsby-source-filesystem/src/gatsby-node.js:183 when the library encounters an invalid state.

Common situations: Occurs when the path option given to gatsby-source-filesystem in gatsby-config.js points to a directory that does not exist. Create the directory or correct the path option.


AI-assisted analysis of gatsbyjs/gatsby@8b06340921 (2026-08-13). Data as JSON: /api/errors/bf3639073d2e60d2. Report an issue: GitHub.