ews-javascript-api icon indicating copy to clipboard operation
ews-javascript-api copied to clipboard

Could not find a declaration file for module 'fetch'

Open leo91000 opened this issue 4 years ago • 1 comments

I am having an issue while trying to compile from typescript :

node_modules/ews-javascript-api/typings/ExchangeWebService.d.ts:3:53 - error TS7016: Could not find a declaration file for module 'fetch'. 'C:/Users
/ZRTW9851/Documents/Projets Orange/tmp2/@doe/worker/node_modules/fetch/lib/fetch.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/fetch` if it exists or add a new declaration (.d.ts) file containing `declare module 'fetch';`

3 import { FetchStream, fetchUrl, FetchOptions } from 'fetch';

How to fix this ?

leo91000 avatar Jan 28 '21 23:01 leo91000

the reason is this repo maintains its own version of type declarations of the dep fetch... and the dep hasn't been updated for years. no clue of why not choosing a modern polyfill.

to resolve this error, you can copy this file and paste inside your project or somewhere that TypeScript can recognize the declaration files.

gao-sun avatar Jun 23 '21 11:06 gao-sun

as of 0.13 this is using axios and removed support for requestjs and fetch both

gautamsi avatar Feb 25 '24 06:02 gautamsi