Storyblok Raises $80M Series C - Read News

What’s the True Total Price of Enterprise CMS? Find out here.

Skip to main content

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.