{"record":{"id":"f4a8e94c70a55000","repo":"gatsbyjs/gatsby","slug":"please-install-gatsby-source-filesystem","errorCode":null,"errorMessage":"Please install gatsby-source-filesystem","messagePattern":"Please install gatsby-source-filesystem","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-plugin-image/src/node-apis/image-processing.ts","lineNumber":45,"sourceCode":"  reporter,\n}: {\n  fullPath: string\n  createNodeId: ParentSpanPluginArgs[\"createNodeId\"]\n  createNode: Actions[\"createNode\"]\n  reporter: Reporter\n}): Promise<FileSystemNode | undefined> {\n  if (!fs.existsSync(fullPath)) {\n    return undefined\n  }\n\n  let file: FileSystemNode\n  try {\n    const {\n      createFileNode,\n    } = require(`gatsby-source-filesystem/create-file-node`)\n    file = await createFileNode(fullPath, createNodeId, {})\n  } catch (e) {\n    reporter.panic(`Please install gatsby-source-filesystem`)\n    return undefined\n  }\n\n  if (!file) {\n    return undefined\n  }\n\n  file.internal.type = `StaticImage`\n\n  createNode(file)\n\n  return file\n}\n\nexport const isRemoteURL = (url: string): boolean =>\n  url.startsWith(`http://`) || url.startsWith(`https://`)\n\nexport async function writeImages({","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/packages/gatsby-plugin-image/src/node-apis/image-processing.ts#L27-L63","documentation":"Inside createImageNode (image-processing.ts:39-46), the plugin dynamically requires 'gatsby-source-filesystem/create-file-node' to call createFileNode. If the require fails (module not found), the catch block calls reporter.panic. This means gatsby-source-filesystem is not installed in the project, yet gatsby-plugin-image's static image processing needs it to turn a local file path into a Gatsby File node.","triggerScenarios":"Using gatsby-plugin-image's <StaticImage> component with a local file path without having gatsby-source-filesystem in the dependency tree. The require('gatsby-source-filesystem/create-file-node') throws MODULE_NOT_FOUND.","commonSituations":"Fresh project that added gatsby-plugin-image but forgot gatsby-source-filesystem. Monorepo where gatsby-source-filesystem is hoisted to a different workspace and not resolvable. Accidental removal of gatsby-source-filesystem from package.json.","solutions":["Install the package: npm install gatsby-source-filesystem (or yarn add)","Ensure gatsby-source-filesystem is listed in gatsby-config.js plugins array","If in a monorepo, verify node_modules resolution: run npm ls gatsby-source-filesystem"],"exampleFix":"// before: package.json missing the dependency\n// after: add to package.json\ndependencies: {\n  \"gatsby-source-filesystem\": \"^4.0.0\",\n}\n\n// gatsby-config.js\nplugins: [\n  `gatsby-plugin-image`,\n  {\n    resolve: `gatsby-source-filesystem`,\n    options: { name: `images`, path: `${__dirname}/src/images` },\n  },\n]","handlingStrategy":"validation","validationCode":"// Pre-build check: verify gatsby-source-filesystem is installed\ntry {\n  require.resolve('gatsby-source-filesystem')\n} catch {\n  console.error('gatsby-source-filesystem is required by gatsby-plugin-image')\n  process.exit(1)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always install gatsby-source-filesystem alongside gatsby-plugin-image","Add a preinstall or postinstall script that verifies required peer dependencies","Keep a checklist of required Gatsby image dependencies: gatsby-plugin-image, gatsby-plugin-sharp, gatsby-transformer-sharp, gatsby-source-filesystem"],"tags":["missing-dependency","gatsby-plugin","image-processing","filesystem"],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}