Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find name 'AbortSignal' during npm run build

node_modules/axios/index.d.ts:93:12 - error TS2304: Cannot find name 'AbortSignal'.

93   signal?: AbortSignal;
              ~~~~~~~~~~~


Found 1 error.

When trying npm run build comand for node typescript project, i am getting above error, something related to axio package. before axio usage, npm run build working fine.

like image 969
MUHAMMAD SHAHID RAFI C P Avatar asked Nov 19 '25 13:11

MUHAMMAD SHAHID RAFI C P


2 Answers

You need to add DOM to the lib array in your tsconfig.json:

"lib": [
      "es2018",
      "DOM"
    ],
like image 159
caveman_dick Avatar answered Nov 22 '25 03:11

caveman_dick


You could also add "skipLibCheck": true, to your tsconfig.json under compilerOptions. This will ignore errors that are present in libs under node_modules

like image 40
vlio20 Avatar answered Nov 22 '25 04:11

vlio20



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!