question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using superagent with typescript causes error TS2304: Cannot find name 'Blob' and 'XMLHttpRequest'

See original GitHub issue

When 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:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

13reactions
exapsycommented, Jan 28, 2019

@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 and compilerOptions.lib.dom

"compilerOptions": {
  "lib": [
    "es6",
    "dom"
  ]
}

If anyone has a remote idea of why is this happening, I would be happy to listen to it.

0reactions
SergioFayacommented, Mar 11, 2019

comfortable

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found