{"record":{"id":"690ff5edc552c614","repo":"gatsbyjs/gatsby","slug":"createnode-must-be-a-function-was-typeof-create-690ff5","errorCode":null,"errorMessage":"createNode must be a function, was ${typeof createNode}","messagePattern":"createNode must be a function, 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":411,"sourceCode":"\n  // if the url isn't already encoded\n  // so decoding it doesn't do anything\n  if (decodeURI(url) === url) {\n    // encode the uri\n    // this accounts for special characters in filenames\n    url = encodeURI(url)\n  }\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) {","sourceCodeStart":393,"sourceCodeEnd":429,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/packages/gatsby-source-wordpress/src/steps/source-nodes/create-nodes/create-remote-file-node/index.js#L393-L429","documentation":"The gatsby-source-wordpress createRemoteFileNode copy validates that createNode is a function. It fires after the createNodeId check and before the cache check. Without a valid createNode, downloaded media would never enter the Gatsby node graph.","triggerScenarios":"Internal plugin call missing createNode; helpers spread incorrectly so actions.createNode is not in scope; fork that lost the createNode forwarding.","commonSituations":"Bugs in a specific gatsby-source-wordpress version where the media-processing refactor dropped createNode from the call; incompatibility between gatsby-source-wordpress and a newer Gatsby core that renamed actions.","solutions":["Upgrade gatsby-source-wordpress to the latest release where internal createNode forwarding is intact.","If forking, verify createNode is destructured from actions and passed to the createRemoteFileNode call.","Confirm the Gatsby core version is within the supported range of gatsby-source-wordpress.","Open an issue with the query/mutation that triggered the path so maintainers can reproduce."],"exampleFix":"null","handlingStrategy":"validation","validationCode":"if (typeof createNode !== 'function') { throw new TypeError('createNode not available in the WordPress media step') }","typeGuard":"const isCreateNode = (v) => typeof v === 'function'","tryCatchPattern":"null","preventionTips":["Upgrade gatsby-source-wordpress","If forking, forward actions.createNode into the createRemoteFileNode call","Verify actions object is populated in the store before the media step"],"tags":["wordpress","gatsby","validation","createnode"],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}