{"record":{"id":"62101c9c9ba1f65a","repo":"gatsbyjs/gatsby","slug":"couldn-t-check-available-apis-make-sure-you-are-o-62101c","errorCode":null,"errorMessage":"Couldn't check available APIs. Make sure you are on gatsby version >=2.13.41","messagePattern":"Couldn't check available APIs\\. Make sure you are on gatsby version >=2\\.13\\.41","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/gatsby-plugin-utils/src/node-api-is-supported.ts","lineNumber":6,"sourceCode":"export function isGatsbyNodeLifecycleSupported(apiName: string): boolean {\n  let availableAPIs\n  try {\n    availableAPIs = require(`gatsby/apis.json`)\n  } catch (e) {\n    throw new Error(\n      `Couldn't check available APIs. Make sure you are on gatsby version >=2.13.41`\n    )\n  }\n\n  return !!availableAPIs?.node?.[apiName]\n}\n","sourceCodeStart":1,"sourceCodeEnd":13,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/packages/gatsby-plugin-utils/src/node-api-is-supported.ts#L1-L13","documentation":"Thrown by gatsby-plugin-utils' isGatsbyNodeLifecycleSupported() when require('gatsby/apis.json') fails. This function checks whether a given Node API name (e.g., 'createSchemaCustomization') is supported by the installed Gatsby version. Same root cause as hasFeature but targets the node lifecycle APIs list.","triggerScenarios":"require('gatsby/apis.json') throws when Gatsby < 2.13.41 or the gatsby package is missing/corrupted; the catch rethrows the version hint.","commonSituations":"A plugin calls isGatsbyNodeLifecycleSupported() to conditionally register a newer lifecycle hook, but the project runs an older Gatsby that lacks apis.json.","solutions":["Upgrade Gatsby to >= 2.13.41 (latest stable recommended).","Verify with npm ls gatsby that only one version is installed.","Reinstall node_modules if the gatsby package appears corrupted.","Pin the plugin calling this function to a version matching your Gatsby major."],"exampleFix":"# before\n\"gatsby\": \"^2.10.0\"\n# after\n\"gatsby\": \"^4.0.0\"","handlingStrategy":"validation","validationCode":"// Guard isGatsbyNodeLifecycleSupported call\nconst gatsbyVersion = require('gatsby/package.json').version\nconst [major, minor] = gatsbyVersion.split('.').map(Number)\nif (major < 2 || (major === 2 && minor < 13)) {\n  return false // API not supported on this version\n}\nreturn isGatsbyNodeLifecycleSupported(apiName)","typeGuard":null,"tryCatchPattern":"try {\n  return isGatsbyNodeLifecycleSupported(apiName)\n} catch {\n  return false // gracefully degrade on old Gatsby\n}","preventionTips":["Always check the Gatsby version before calling lifecycle support checks.","Use try-catch around hasFeature/isGatsbyNodeLifecycleSupported to degrade gracefully.","Keep Gatsby updated to the latest stable."],"tags":["gatsby","version-mismatch","lifecycle-api","feature-detection"],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}