{"record":{"id":"89a4b8b85f4bb360","repo":"gatsbyjs/gatsby","slug":"gatsby-plugin-image-couldn-t-find-image-data-cac","errorCode":null,"errorMessage":"[gatsby-plugin-image] Couldn't find image data cache file","messagePattern":"\\[gatsby-plugin-image\\] Couldn't find image data cache file","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-plugin-image/src/babel-plugin-parse-static-images.ts","lineNumber":61,"sourceCode":"\n        if (unresolvedProps.length) {\n          // TODO: Add a shortlink to docs on the plugin\n          error = `Could not find values for the following props at build time: ${unresolvedProps.join(\n            `, `\n          )}`\n          console.warn(`[gatsby-plugin-image] ${error}`)\n        }\n\n        // Adding the filename to the hashing, like in \"extractStaticImageProps\" function\n        if (state.filename) {\n          props.filename = slash(state.filename)\n        }\n        const hash = hashOptions(props)\n\n        const cacheDir = (this.opts as Record<string, string>)?.cacheDir\n\n        if (!cacheDir) {\n          console.warn(\n            `[gatsby-plugin-image] Couldn't find image data cache file`\n          )\n        }\n\n        const filename = path.join(cacheDir, `${hash}.json`)\n        let data: Record<string, unknown> | undefined\n\n        // If there's no src prop there's no point in checking if it exists\n        if (!unresolvedProps.includes(`src`)) {\n          try {\n            data = fs.readJSONSync(filename)\n          } catch (e) {\n            // TODO add info about minimum Gatsby version once this is merged\n            const msg = stripIndent`\n            Could not read image data file \"${filename}\". \n            This may mean that the images in \"${this.filename}\" were not processed.\n            Please ensure that your gatsby version is at least 2.24.78.`\n            error += msg","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby-plugin-image/src/babel-plugin-parse-static-images.ts#L43-L79","documentation":"StaticImage babel-plugin warning: no cached image-data JSON exists for the computed options hash — the image was never processed by writeImages during the node phase of the build, so there is nothing to inline at compile time.","triggerScenarios":"Thrown at packages/gatsby-plugin-image/src/babel-plugin-parse-static-images.ts:61 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the image file exists and StaticImage src is a static string","Rebuild from a clean cache (`gatsby clean`)","Ensure Gatsby is at least 2.24.78 and gatsby-plugin-image is configured"],"exampleFix":null,"handlingStrategy":"validation","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-14T00:17:10.932Z"}