{"record":{"id":"dd6b6600e65a6b56","repo":"gatsbyjs/gatsby","slug":"couldn-t-check-available-apis-make-sure-you-are-o","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/has-feature.ts","lineNumber":12,"sourceCode":"import type { AvailableFeatures } from \"gatsby\"\n\n/**\n * Check the readme for a list of available features.\n */\nexport function hasFeature(name: AvailableFeatures): boolean {\n  try {\n    const availableAPIs = require(`gatsby/apis.json`)\n\n    return !!availableAPIs?.features?.includes(name)\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","sourceCodeStart":1,"sourceCodeEnd":17,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/packages/gatsby-plugin-utils/src/has-feature.ts#L1-L17","documentation":"Thrown by gatsby-plugin-utils' hasFeature() when require('gatsby/apis.json') fails, meaning the installed Gatsby version is too old to ship the apis.json manifest (introduced in Gatsby 2.13.41). The function checks whether a named feature flag exists in the Gatsby runtime's feature list.","triggerScenarios":"require('gatsby/apis.json') throws if Gatsby is older than 2.13.41 or if the gatsby package is corrupted/missing. The catch rethrows this version-mismatch message.","commonSituations":"A plugin calls hasFeature() but the project pins Gatsby to a pre-2.13.41 version, or the gatsby node_modules is partially installed/corrupted.","solutions":["Upgrade Gatsby to at least version 2.13.41 (preferably the latest 2.x or 4.x/5.x line).","Run npm ls gatsby to confirm the installed version and check for version conflicts in a monorepo.","Delete node_modules and reinstall to fix a corrupted gatsby package.","If intentionally on an old Gatsby, update the plugin that calls hasFeature() to a version compatible with your Gatsby."],"exampleFix":"# before\n\"gatsby\": \"^2.12.0\"\n# after\n\"gatsby\": \"^2.13.41\"","handlingStrategy":"validation","validationCode":"// Check Gatsby version before calling hasFeature\nconst gatsbyPkg = require('gatsby/package.json')\nconst [major, minor, patch] = gatsbyPkg.version.split('.').map(Number)\nconst isSupported = major > 2 || (major === 2 && (minor > 13 || (minor === 13 && patch >= 41)))\nif (!isSupported) {\n  throw new Error('Gatsby >= 2.13.41 required')\n}","typeGuard":null,"tryCatchPattern":"try {\n  const apis = require('gatsby/apis.json')\n} catch (e) {\n  // upgrade gatsby before calling hasFeature\n}","preventionTips":["Pin Gatsby to a version >= 2.13.41 in package.json.","Run npm ls gatsby to detect version conflicts in monorepos.","Add an engines check in package.json for gatsby compatibility."],"tags":["gatsby","version-mismatch","feature-detection","missing-module"],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}