Skip to content

fix(eio-client/types): avoid MapIterator in generated typings - #5568

Merged
darrachequesne merged 1 commit into
socketio:mainfrom
lazerg:fix/issue-5567-mapiterator
Nov 3, 2026
Merged

darrachequesne merged 1 commit into
socketio:mainfrom
lazerg:fix/issue-5567-mapiterator

Conversation

@lazerg

@lazerg lazerg commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

The kind of change this PR does introduce

  • a bug fix
  • a new feature
  • an update to the documentation
  • a code change that improves performance
  • other

Current behavior

The cookies getter in globals.node.ts has no return type, so TypeScript 6 infers it from Map#entries() and writes MapIterator<[string, Cookie]> into globals.node.d.ts. MapIterator only exists in the lib files of TypeScript 5.6 and later, so projects on an older compiler (like the Angular 17 client in the basic CRUD example, which uses TypeScript 5.2) fail with TS2552: Cannot find name 'MapIterator' unless skipLibCheck is on.

New behavior

The getter is annotated as IterableIterator<[string, Cookie]>, which every TypeScript version understands. I checked that the regenerated .d.ts compiles cleanly with TypeScript 5.0 and 5.2.

Other information (e.g. related issues)

Fixes #5567

@darrachequesne
darrachequesne merged commit b8b6ef0 into socketio:main Nov 3, 2026
@darrachequesne

Copy link
Copy Markdown
Member

Good catch, thanks 👍

@darrachequesne

Copy link
Copy Markdown
Member

Released in engine.io-client@6.6.8.

Release notes: https://github.com/socketio/socket.io/releases/tag/engine.io-client%406.6.8

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

Successfully merging this pull request may close these issues.

"Basic CRUD application" can't be started with Angular client

2 participants