gatsbyjs/gatsby · error · Error

Couldn't check available APIs. Make sure you are on gatsby v

Error message

Couldn't check available APIs. Make sure you are on gatsby version >=2.13.41

What it means

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.

Source

Thrown at packages/gatsby-plugin-utils/src/has-feature.ts:12

import type { AvailableFeatures } from "gatsby"

/**
 * Check the readme for a list of available features.
 */
export function hasFeature(name: AvailableFeatures): boolean {
  try {
    const availableAPIs = require(`gatsby/apis.json`)

    return !!availableAPIs?.features?.includes(name)
  } catch (e) {
    throw new Error(
      `Couldn't check available APIs. Make sure you are on gatsby version >=2.13.41`
    )
  }
}

View on GitHub (pinned to 8b06340921)

Solutions

  1. Upgrade Gatsby to at least version 2.13.41 (preferably the latest 2.x or 4.x/5.x line).
  2. Run npm ls gatsby to confirm the installed version and check for version conflicts in a monorepo.
  3. Delete node_modules and reinstall to fix a corrupted gatsby package.
  4. If intentionally on an old Gatsby, update the plugin that calls hasFeature() to a version compatible with your Gatsby.

Example fix

# before
"gatsby": "^2.12.0"
# after
"gatsby": "^2.13.41"
Defensive patterns

Strategy: validation

Validate before calling

// Check Gatsby version before calling hasFeature
const gatsbyPkg = require('gatsby/package.json')
const [major, minor, patch] = gatsbyPkg.version.split('.').map(Number)
const isSupported = major > 2 || (major === 2 && (minor > 13 || (minor === 13 && patch >= 41)))
if (!isSupported) {
  throw new Error('Gatsby >= 2.13.41 required')
}

Try / catch

try {
  const apis = require('gatsby/apis.json')
} catch (e) {
  // upgrade gatsby before calling hasFeature
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of gatsbyjs/gatsby@8b06340921 (2026-08-13). Data as JSON: /api/errors/dd6b6600e65a6b56. Report an issue: GitHub.