Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find name XMLHttpRequest in polling-xhr.d.ts #5310

Open
Granjow opened this issue Feb 27, 2025 · 1 comment
Open

Cannot find name XMLHttpRequest in polling-xhr.d.ts #5310

Granjow opened this issue Feb 27, 2025 · 1 comment

Comments

@Granjow
Copy link

Granjow commented Feb 27, 2025

With version 4.8.1 of socket.io-client and Node.js 22, "@types/node": "22.13.5" and "typescript": "^5.7.3", I have a build error:

node_modules/engine.io-client/build/esm/transports/polling-xhr.d.ts:65:58 - error TS2304: Cannot find name 'XMLHttpRequest'.

65     constructor(createRequest: (opts: RequestOptions) => XMLHttpRequest, uri: string, opts: RequestOptions);

Probably related: socketio/socket.io-client#1561

@darrachequesne
Copy link
Member

Hi! I wasn't able to reproduce: https://github.com/socketio/socket.io/tree/main/examples/typescript-example/esm

$ node -v
v22.8.0

$ npm ls typescript
typescript-example@1.0.0 /git/socket.io/socket.io/examples/typescript-example/esm
├─┬ ts-node@10.9.2
│ └── typescript@5.8.2 deduped
└── typescript@5.8.2

$ npm ls @types/node
typescript-example@1.0.0 /git/socket.io/socket.io/examples/typescript-example/esm
├─┬ socket.io@4.8.1
│ └─┬ engine.io@6.6.4
│   ├─┬ @types/cors@2.8.17
│   │ └── @types/node@22.13.8 deduped
│   └── @types/node@22.13.8 deduped
└─┬ ts-node@10.9.2
  └── @types/node@22.13.8

$ npm run build

> typescript-example@1.0.0 build
> tsc

Could you please check?

@darrachequesne darrachequesne transferred this issue from socketio/socket.io-client Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants