AbortController is not defined

I amimplementing a library that uses AbortController, but I’m getting an error that AbortController is not defined.

I am using nodejs 16, and I’ve also tried with nodejs 18

Here I add you a snippet:

import {  DelegateV2 } from "@delegatexyz/sdk"
import { http } from "viem"

const dc = new DelegateV2(http())

const isDelegateForAll = await dc.getIncomingDelegations('0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266')
console.log({ isDelegateForAll})

Thanks in advance

I used this with NodeJS14 (in Meteor): abort-controller - npm

I take it you don’t use Meteor. You can initialize the AbortController early from either your NodeJS (>15) or from the NPM.

Your problem might have something to do with this: " AbortController API is a relatively new addition to Node. Therefore, a few asynchronous APIs support it at the moment. These APIs include the new Fetch API, timers, fs.readFile , fs.writeFile , http.request , and https.request ."