{"record":{"id":"89741c4edb6702c9","repo":"gatsbyjs/gatsby","slug":"please-upgrade-gatsby-plugin-sharp","errorCode":null,"errorMessage":"Please upgrade gatsby-plugin-sharp","messagePattern":"Please upgrade gatsby-plugin-sharp","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-plugin-image/src/node-apis/image-processing.ts","lineNumber":206,"sourceCode":"export async function writeImage(\n  file: FileSystemNode,\n  args: ISharpGatsbyImageArgs,\n  pathPrefix: string,\n  reporter: Reporter,\n  cache: GatsbyCache,\n  filename: string\n): Promise<void> {\n  let generateImageData\n  try {\n    generateImageData = require(`gatsby-plugin-sharp`).generateImageData\n  } catch (e) {\n    reporter.panic(`Please install gatsby-plugin-sharp`)\n  }\n  try {\n    const options = { file, args, pathPrefix, reporter, cache }\n\n    if (!generateImageData) {\n      reporter.warn(`Please upgrade gatsby-plugin-sharp`)\n      return\n    }\n    // get standard set of fields from sharp\n    const sharpData = await generateImageData(options)\n\n    if (sharpData) {\n      // Write the image properties to the cache\n      await fs.writeJSON(filename, sharpData)\n    } else {\n      reporter.warn(`Could not process image ${file.relativePath}`)\n    }\n  } catch (e) {\n    reporter.warn(`Error processing image ${file.relativePath}. \\n${e.message}`)\n  }\n}\n","sourceCodeStart":188,"sourceCodeEnd":222,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby-plugin-image/src/node-apis/image-processing.ts#L188-L222","documentation":"Version guard in writeImage: gatsby-plugin-sharp loaded, but its generateImageData export is falsy (an older gatsby-plugin-sharp without that API). Image writing is skipped with this warning telling the user to upgrade gatsby-plugin-sharp; a missing package instead triggers reporter.panic(\"Please install gatsby-plugin-sharp\").","triggerScenarios":"Thrown at packages/gatsby-plugin-image/src/node-apis/image-processing.ts:206 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Upgrade gatsby-plugin-sharp (and gatsby-plugin-image) to matching latest versions"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e85d62f1779e353eaac1753211629a26d123e26c","analyzedAt":"2026-08-26T17:50:09.662Z","contentChangedAt":"2026-08-26T17:50:09.662Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}