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

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

How to solve this problem?

+3


source to share


1 answer


You have to add downlevelIteration

to compilerOptions:



"compilerOptions": {
  "target": "es5",
  "module": "es2015",
  "moduleResolution": "node",
  "lib": [ "DOM", "ES2015" ],
  "downlevelIteration": true,
  ...
},

      

+6


source







All Articles