You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mkdir typescript-5-node-14
cd typescript-5-node-14
npm i typescript @types/node@14
touch index.ts
npx tsc index.ts
As of writing, this installs TypeScript 5.8.2 and @types/node 14.18.63.
🕗 Version & Regression Information
This changed between versions 5.4 and 5.5
This changed in commit or PR _______
This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
I was unable to test this on prior versions because _______
🙁 Actual behavior
node_modules/@types/node/globals.d.ts:126:13 - error TS2403: Subsequent variable declarations must have the same type. Variable 'AbortSignal' must be of type '{ new (): AbortSignal; prototype: AbortSignal; abort(reason?: any): AbortSignal; any(signals: AbortSignal[]): AbortSignal; timeout(milliseconds: number): AbortSignal; }', but here has type '{ new (): AbortSignal; prototype: AbortSignal; abort(reason?: any): AbortSignal; timeout(milliseconds: number): AbortSignal; }'.
126 declare var AbortSignal: {
~~~~~~~~~~~
node_modules/typescript/lib/lib.dom.d.ts:2606:13
2606 declare var AbortSignal: {
~~~~~~~~~~~
'AbortSignal' was also declared here.
Found 1 error in node_modules/@types/node/globals.d.ts:126
🙂 Expected behavior
Compilation without errors.
Additional information about the issue
It works fine if TypeScript <= 5.4 is used.
The text was updated successfully, but these errors were encountered:
siddharthvp
changed the title
TypeScript 5 declaration of AbortSignal conflicts with Node.js v14 types
TypeScript 5.5+ declaration of AbortSignal conflicts with Node.js v14 types
Mar 19, 2025
lib.dom.d.ts describes the types of a fully compliant web browser (the HTML platform). @types/node describes the types of a full Node.js environment. I wouldn't expect the two to be compatible, and there is no real js environment that perfectly 100% implements both of these at the same time.
This feels like a duplicate of or closely related to #43972.
🔎 Search Terms
Steps to reproduce:
mkdir typescript-5-node-14 cd typescript-5-node-14 npm i typescript @types/node@14 touch index.ts npx tsc index.ts
As of writing, this installs TypeScript 5.8.2 and @types/node 14.18.63.
🕗 Version & Regression Information
🙁 Actual behavior
🙂 Expected behavior
Compilation without errors.
Additional information about the issue
It works fine if TypeScript <= 5.4 is used.
The text was updated successfully, but these errors were encountered: