Translate

[Javascript] IE 에서 'includes' 속성이나 메서드를 지원하지 않습니다. 오류






환경
 - JHipster 4.13.1 (Spring Boot + Angular 5)




Internet Explorer 11 (IE11) 에서 아래와 같은 오류가 발생했다.
1004lucifer





아래와 같이 polyfill 을 추가하여 하여 이슈를 해결했다.

import 'core-js/es6/date';
import 'core-js/es6/array';
import 'core-js/es7/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/weak-map';
import 'core-js/es6/set';





PS.
아래와 같은 다른 방법도 있다.
1004lucifer
1. JavaScript 에서 직접 include 함수를 사용한경우
 - indexOf를 대신 사용 (http://aramk.tistory.com/28)

2. npm / yarn 을 사용하는 경우 polyfill 라이브러리를 추가하면 된다.
 - https://www.npmjs.com/package/array.prototype.includes




참고
 - https://github.com/jhipster/generator-jhipster/issues/6953

댓글