Skip to content
Latchkey

GrowthBook "Failed to fetch features" in CI

The GrowthBook SDK called loadFeatures and could not retrieve the feature definitions from the API host (GrowthBook Cloud or a self-hosted instance). Either the client key or apiHost is wrong, or the host is unreachable. Until features load, every isOn / getFeatureValue returns the fallback.

What this error means

GrowthBook logs "Failed to fetch features" or loadFeatures rejects, and feature checks all return their default because the feature map is empty.

GrowthBook
[GrowthBook] Failed to fetch features:
GET https://cdn.growthbook.io/api/features/<clientKey> 404 (Not Found)

Common causes

The client key or apiHost is wrong

A mistyped client key, or an apiHost that does not match your GrowthBook deployment, returns 404 or the wrong payload.

The API host is unreachable from the runner

Egress to the GrowthBook CDN or self-hosted API is blocked, so loadFeatures cannot complete.

How to fix it

Set the correct apiHost and client key, and await loadFeatures

  1. Copy the API host and SDK client key from GrowthBook, SDK Connections.
  2. Pass them into the client and await loadFeatures before evaluating.
  3. For self-hosted, point apiHost at your instance, not the cloud CDN.
growthbook.js
const gb = new GrowthBook({
  apiHost: 'https://cdn.growthbook.io',
  clientKey: process.env.GROWTHBOOK_CLIENT_KEY,
});
await gb.loadFeatures();

Provide features directly for offline tests

Pass a features payload so evaluation is deterministic and needs no network fetch.

growthbook.test.js
const gb = new GrowthBook({
  features: require('./growthbook-features.json'),
});

How to prevent it

  • Keep the GrowthBook client key in CI secrets and set the right apiHost.
  • Await loadFeatures before any feature evaluation.
  • Pass features directly in tests to remove the network dependency.

Frequently asked questions

What causes "GrowthBook "Failed to fetch features""?
A mistyped client key, or an apiHost that does not match your GrowthBook deployment, returns 404 or the wrong payload.
How do I fix GrowthBook "Failed to fetch features"?
Set the correct apiHost and client key, and await loadFeatures

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card