Almost EVERYONE who tried headless systems said they saw benefits. Download the state of CMS now!

Storyblok now on AWS Marketplace: Read more

O’Reilly Report: Decoupled Applications and Composable Web Architectures - Download Now

Empower your teams & get a 582% ROI: See Storyblok's CMS in action

Skip to main content

Fixing Headers not defined error in Storyblok SDK

  • FAQ
  • Fixing Headers not defined error in Storyblok SDK

All Storyblok SDKs are based on the storyblok-js-client v5, built using the native Fetch API. There are some environments and versions of Node where the Fetch API, such as (Node <= 17), is not implemented, and you'd need to install a polyfill.

hint:

We recommend isomorphic fetch polyfill.

You get the error below when the fetch API isn't available in your environment.

ReferenceError : Headers is not defined

To fix the error above, install isomorphic fetch polyfill in your application using the command below

        
      npm install --save isomorphic-fetch
    

You can learn more about the isomorphic fetch API here.