{"record":{"id":"945cf64496e7b790","repo":"gatsbyjs/gatsby","slug":"gatsby-plugin-image-could-not-read-image-data-fi","errorCode":null,"errorMessage":"[gatsby-plugin-image] Could not read image data file \"${filename}\". This may mean that the images in \"${this.filename}\" were not processed. Please ensure that your gatsby version is at least 2.24.78.","messagePattern":"\\[gatsby-plugin-image\\] Could not read image data file \"(.+?)\"\\. This may mean that the images in \"(.+?)\" were not processed\\. Please ensure that your gatsby version is at least 2\\.24\\.78\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-plugin-image/src/babel-plugin-parse-static-images.ts","lineNumber":80,"sourceCode":"            `[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\n            console.warn(`[gatsby-plugin-image] ${msg}`)\n          }\n        }\n\n        if (!data) {\n          console.warn(\n            `[gatsby-plugin-image] No data found for image \"${props.src}\"`\n          )\n\n          // Add the error message to the component so we can show it in the browser\n          const newProp = t.jsxAttribute(\n            t.jsxIdentifier(`__error`),\n\n            t.jsxExpressionContainer(\n              t.stringLiteral(`No data found for image \"${props.src}\"\n              ${error || ``}`)\n            )\n          )\n          nodePath.node.attributes.push(newProp)","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby-plugin-image/src/babel-plugin-parse-static-images.ts#L62-L98","documentation":"Error \"[gatsby-plugin-image] Could not read image data file \"${filename}\". This may mean that the images in \"${this.filename}\" were not processed. Please ensure that your gatsby version is at least 2.24.78.\" thrown in gatsbyjs/gatsby.","triggerScenarios":"Thrown at packages/gatsby-plugin-image/src/babel-plugin-parse-static-images.ts:80 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Upgrade Gatsby to at least 2.24.78 so image data files are written","Run `gatsby clean` to clear stale caches and rebuild","Verify the images in the file were processed during the node phase"],"exampleFix":null,"handlingStrategy":"try-catch","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"}