Type 'Set<any>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.

da.circle·2023년 4월 3일
0

타입스크립트에서 Set 사용중에 다음과 같은 에러가 발생했다.

출처)
https://stackoverflow.com/questions/73099543/type-setunknown-can-only-be-iterated-through-when-using-the-downleveliter

  • 해결 ) tsconfig.json 파일에서 compilerOptions의 target을 'es2015'로 변경한다.
"compilerOptions": {
    "target": "es5",
      ...
}
    
"compilerOptions": {
    "target": "es2015",
      ...
}
profile
프론트엔드 개발자를 꿈꾸는 사람( •̀ ω •́ )✧

0개의 댓글

관련 채용 정보