Using superagent with typescript causes error TS2304: Cannot find name 'Blob' and 'XMLHttpRequest'
See original GitHub issueWhen I run tsc to compile my code I get the following error. I also installed @types/superagent
node_modules/@types/superagent/index.d.ts:29:29 - error TS2304: Cannot find name 'Blob'.
29 type MultipartValueSingle = Blob | Buffer | fs.ReadStream | string | boolean | number;
~~~~
node_modules/@types/superagent/index.d.ts:116:14 - error TS2304: Cannot find name 'XMLHttpRequest'.
116 xhr: XMLHttpRequest;
~~~~~~~~~~~~~~
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
types/superagent error TS2304: Cannot find name ... - GitHub
I tried using the latest xxxx/xxxx.d.ts file in this repo and had problems. I tried using the latest stable version of tsc.
Read more >Angular and Typescript: Can't find names - Error: cannot find ...
ts(1,37): Error TS2304: Cannot find name 'Zone'. This is the code: import 'reflect-metadata'; import {bootstrap, Component ...
Read more >@types/superagent - npm
Start using @types/superagent in your project by running `npm i ... TypeScript icon, indicating that this package has built-in type ...
Read more >angular/angular - Gitter
@frederikprijck I am getting this erros ERROR in src/app/profile/profile.component.spec.ts(11,17): error TS2304: Cannot find name 'getCurrentUser'. when I ...
Read more >Cannot find IArrItem and IGLTFBaseLoaderExtension
Cannot find IArrItem and IGLTFBaseLoaderExtension ... error TS2304: Build:Cannot find name 'IGLTFBaseLoaderExtension'. I have types set in ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@SergioFaya Im still having this problem, if it’s comfortable for you, could you tell me how did you work arround this? Thank you in advance.
Edit - Solution
It seems like I found the solution, but not the problem. My new configuration file just includes
compilerOptions.lib.es6
andcompilerOptions.lib.dom
If anyone has a remote idea of why is this happening, I would be happy to listen to it.
If I not wrong I manage to solve it by just updating to the latest version. But I can’t say for sure because I fixed it long ago