Open OliverJAsh opened 2 years ago
Yup, I simply deleted my line
import AbortController from "abort-controller";
and then removed that npm package
npm un abort-controller
and I was good to go.
Yup, I simply deleted my line
import AbortController from "abort-controller";
and then removed that npm package
npm un abort-controller
and I was good to go.
I might be wrong but this solution would only work if the code was to be executed only on the browser, right? What if we need to use it in a node service? Is this interface globally available as well in this case?
This was in a node service for me using axios. I don't know what provides the type but I do have @types/node
installed so maybe it comes from there? Or maybe @types/express
which I also have installed?
Since v15.4.0 Node.js comes with AbortController
out of the box, so that's probably why it still works even after removing this package.
@cmd-johnson cheers, I realize that's why it works, I was mentioning the types for VSCode to not complain, which undoubtedly is provided by my @types/node install. I think I incorrectly ascertained that @riboher was missing that. Seems they were just speculating.
Using latest version of all packages at time of writing:
package.json
:main.ts
:We can fix it by using the global
AbortController
type: