typescript globals: @types/web overrides fetch

Hey all I have a pnpm monorepo with a couple of packages and two next apps. In the next apps 'window' and 'document' arent read by typescript unless I install "@types/web" as a dependency. Works great. The problem is when it's installed my fetch definitions get nuked:
Property 'arrayBuffer' does not exist on type 'Response'.
Property 'arrayBuffer' does not exist on type 'Response'.
Property 'json' does not exist on type 'Response'.
Property 'json' does not exist on type 'Response'.
Anyone ran into this before? Could be related?? https://github.com/DefinitelyTyped/DefinitelyTyped/issues/60924
GitHub
[email protected] version not fetch global api ? · Issue #60924 · Definit...
I use @types/[email protected] version ,but use fetch fail,typescript to me "fetch is not defined" Could I know , why "fetch is not defined" ?
1 Reply
Jim
JimOP8mo ago
so basically, typescript is using the fetch from @types/node ok.. I can force ts to read from the dom library by prefixing the file with
/// <reference lib="dom" />
/// <reference lib="dom" />
Want results from more Discord servers?
Add your server