{"record":{"id":"21480fb5567471fa","repo":"gatsbyjs/gatsby","slug":"neither-cache-or-getcache-was-passed-getcache-21480f","errorCode":null,"errorMessage":"Neither \"cache\" or \"getCache\" was passed. getCache must be function that return Gatsby cache, \"cache\" must be the Gatsby cache, was ${typeof cache}","messagePattern":"Neither \"cache\" or \"getCache\" was passed\\. getCache must be function that return Gatsby cache, \"cache\" must be the Gatsby cache, was (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-source-wordpress/src/steps/source-nodes/create-nodes/create-remote-file-node/index.js","lineNumber":418,"sourceCode":"  }\n\n  // validation of the input\n  // without this it's notoriously easy to pass in the wrong `createNodeId`\n  // see gatsbyjs/gatsby#6643\n  if (typeof createNodeId !== `function`) {\n    throw new Error(\n      `createNodeId must be a function, was ${typeof createNodeId}`\n    )\n  }\n  if (typeof createNode !== `function`) {\n    throw new Error(`createNode must be a function, was ${typeof createNode}`)\n  }\n  if (typeof getCache === `function`) {\n    // use cache of this plugin and not cache of function caller\n    cache = getCache(`gatsby-source-filesystem`)\n  }\n  if (typeof cache !== `object`) {\n    throw new Error(\n      `Neither \"cache\" or \"getCache\" was passed. getCache must be function that return Gatsby cache, \"cache\" must be the Gatsby cache, was ${typeof cache}`\n    )\n  }\n\n  // Check if we already requested node for this remote file\n  // and return stored promise if we did.\n  if (processingCache[url]) {\n    return processingCache[url]\n  }\n\n  if (!url || isWebUri(url) === undefined) {\n    return Promise.reject(\n      new Error(\n        `url passed to create-remote-file-node is either missing or not a proper web uri: ${url}`\n      )\n    )\n  }\n","sourceCodeStart":400,"sourceCodeEnd":436,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/packages/gatsby-source-wordpress/src/steps/source-nodes/create-nodes/create-remote-file-node/index.js#L400-L436","documentation":"The gatsby-source-wordpress createRemoteFileNode copy requires a cache (or getCache). After the getCache fallback resolves, if cache is still not an object this error fires. The plugin caches downloaded media across builds to avoid refetching.","triggerScenarios":"Internal plugin refactor that stopped forwarding cache; running outside a Gatsby lifecycle that provides cache; broken helpers object in the store.","commonSituations":"Version mismatch between gatsby-source-wordpress and Gatsby core; stale internal state in the plugin store after a hot reload in gatsby develop; forking that dropped cache forwarding.","solutions":["Upgrade gatsby-source-wordpress (and Gatsby core) to matching, current versions.","Restart gatsby develop / gatsby clean to clear stale internal state.","If forking, ensure cache is forwarded into the createRemoteFileNode call site.","Confirm pluginOptions and gatsbyApi are correctly populated in the store before media processing runs."],"exampleFix":"null","handlingStrategy":"validation","validationCode":"if (!(typeof cache === 'object' && cache)) { throw new TypeError('Cache not available in the WordPress media step') }","typeGuard":"const isCache = (v) => v && typeof v === 'object' && typeof v.get === 'function'","tryCatchPattern":"null","preventionTips":["Upgrade gatsby-source-wordpress and run gatsby clean","Confirm pluginOptions and gatsbyApi are populated in the store","If forking, forward cache into the media step"],"tags":["wordpress","gatsby","validation","cache"],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}