You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the storyblok-js-client is used in a project that has another package that uses the undici-types package in package-lock.json, the sbFetch.ts throws a type error.
Expected Behavior
No error should be thrown and the project should be able to build with storyblok-js-client without issues.
Current Behavior
Our current Next.js project uses the following dependencies:
@types/node
storybook
commitlint
and when either of these dependencies is upgraded to their latest version, the undici-types package is introduced in our package-lock.json file. Then, when we try building our next.js project, we are greeted with the following error:
./node_modules/storyblok-js-client/src/sbFetch.ts:33:50
Type error: No overload matches this call.
Overload 1 of 2, '(input: RequestInfo, init?: RequestInit | undefined): Promise<Response>', gave the following error.
Argument of type 'string | Request | URL | URL | Request' is not assignable to parameter of type 'RequestInfo'.
Type 'Request' is not assignable to type 'RequestInfo'.
Property 'duplex' is missing in type 'Request' but required in type 'import("/home/theo/Projects/EF/product-sites/node_modules/undici-types/fetch").Request'.
Overload 2 of 2, '(input: RequestInfo | URL, init?: RequestInit | undefined): Promise<Response>', gave the following error.
Argument of type 'string | Request | URL | URL | Request' is not assignable to parameter of type 'RequestInfo | URL'.
Type 'Request' is not assignable to type 'RequestInfo | URL'.
Property 'referrer' is missing in type 'import("/home/theo/Projects/EF/product-sites/node_modules/undici-types/fetch").Request' but required in type 'Request'.
31 | this.timeout = $c?.timeout ? $c.timeout * 1000 : 0
32 | this.responseInterceptor = $c.responseInterceptor
> 33 | this.fetch = (...args) => ($c.fetch ? $c.fetch(...args) : fetch(...args))
| ^
34 | this.ejectInterceptor = false
35 | this.url = ''
36 | this.parameters = {} as ISbStoriesParams
Steps to Reproduce
Create a new Next.js project using npx create-next-app@latest
Switch to using Node.js v20
Install the following devDependencies: @types/node , storybook , commitlint at their latest versions
Make sure that package-lock.json includes the undici-types package
Try building the project using next build
The text was updated successfully, but these errors were encountered:
When the storyblok-js-client is used in a project that has another package that uses the
undici-types
package in package-lock.json, thesbFetch.ts
throws a type error.Expected Behavior
No error should be thrown and the project should be able to build with storyblok-js-client without issues.
Current Behavior
Our current Next.js project uses the following dependencies:
@types/node
storybook
commitlint
and when either of these dependencies is upgraded to their latest version, the
undici-types
package is introduced in ourpackage-lock.json
file. Then, when we try building our next.js project, we are greeted with the following error:Steps to Reproduce
npx create-next-app@latest
@types/node
,storybook
,commitlint
at their latest versionspackage-lock.json
includes theundici-types
packagenext build
The text was updated successfully, but these errors were encountered: