Skip to content

observable.map constructor type error in TS 5.9 #4573

@mbest

Description

@mbest

Intended outcome:

Existing code continues to work.

Actual outcome:

Existing code generates a compiler error.

How to reproduce the issue:

Here is a working example in TypeScript 5.8

Here is the same code in TypeScript 5.9

The error is:

Argument of type '(string | Application)[][]' is not assignable to parameter of type 'IObservableMapInitialValues<string | Application, string | Application> | undefined'.
  Type '(string | Application)[][]' is not assignable to type 'IMapEntries<string | Application, string | Application>'.
    Type '(string | Application)[]' is not assignable to type 'IMapEntry<string | Application, string | Application>'.
      Target requires 2 element(s) but source may have fewer.(2345)

Versions

MobX 6.13.7
TypeScript 5.9.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions