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;
~~~~~~~~~~~~~~
Please report it to the author of index.d.ts. We don't maintain this file.
Ok, thanks.
@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.
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.
@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 includescompilerOptions.lib.es6andcompilerOptions.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.
this could be perfect solution of the issue, cause superAgent supports both browser and node. So when you use superAgent with TypeScript, some browser supports need to be added and that means you need to add dom to compilerOptions.lib
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
Most helpful comment
@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.es6andcompilerOptions.lib.domIf anyone has a remote idea of why is this happening, I would be happy to listen to it.