Using the management API to create a component, the error below is thrown and the operation fails.
ReferenceError: Headers is not defined
Expected Behavior
The given component is created in the given space and I get a representation of the component as response.
Current Behavior
The following error is thrown and the operation fails.
ReferenceError: Headers is not defined
at new $ (/path/to/project/node_modules/storyblok-js-client/dist/index.umd.js:24:6888)
at Object.<anonymous> (/path/to/project/component.js:3:19)
at Module._compile (node:internal/modules/cjs/loader:1155:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
at Module.load (node:internal/modules/cjs/loader:1033:32)
at Function.Module._load (node:internal/modules/cjs/loader:868:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:22:47
Steps to Reproduce
Create a new project directory: $ mkdir sb-test.
Change to that directory: $ cd sb-test.
Initialize the node project: $ npm init -y.
Install storyblok-js-client: $ npm i storyblok-js-client`.
Create component.js with the following content (use your own auth token and space id):
the code above is taken almost verbatim from the doc
it is only modified for reproducibility and privacy
looking at /path/to/project/node_modules/storyblok-js-client/dist/index.umd.js, Headers is referenced twice but never defined/declared/imported/required,
Using the management API to create a component, the error below is thrown and the operation fails.
Expected Behavior
The given component is created in the given space and I get a representation of the component as response.
Current Behavior
The following error is thrown and the operation fails.
Steps to Reproduce
Create a new project directory:
$ mkdir sb-test
.Change to that directory:
$ cd sb-test
.Initialize the node project:
$ npm init -y
.Install storyblok-js-client: $ npm i storyblok-js-client`.
Create
component.js
with the following content (use your own auth token and space id):Run the code:
$ node component.js
.A few notes:
/path/to/project/node_modules/storyblok-js-client/dist/index.umd.js
,Headers
is referenced twice but never defined/declared/imported/required,Environment