Skip to content

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

Open
lazerg wants to merge 1 commit into
socketio:mainfrom
lazerg:fix/issue-5567-mapiterator
Open

lazerg wants to merge 1 commit into
socketio:mainfrom
lazerg:fix/issue-5567-mapiterator

Conversation

@lazerg

@lazerg lazerg commented Oct 5, 2026

Copy link
Copy Markdown

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

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

1 participant