Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Type 'Map<string, any>' is not an array type or a string type?

Adding lib "ES2015" or higher solves every other type issue for typescript compilation with target ES5, but Map just doesn't want to work.

How can this issue be solved?

like image 566
Kesarion Avatar asked May 10 '17 07:05

Kesarion


1 Answers

You have to add downlevelIteration to compilerOptions:

"compilerOptions": {
  "target": "es5",
  "module": "es2015",
  "moduleResolution": "node",
  "lib": [ "DOM", "ES2015" ],
  "downlevelIteration": true,
  ...
},
like image 154
Kesarion Avatar answered Sep 29 '22 12:09

Kesarion