본문 바로가기
Study Note/Angular

Angular 8 #error:“moment” has no exported member 'default'

by 시뮝 2020. 5. 12.
728x90

Angular Material 의 Datepicker with custom formats 샘플 소스를 테스트 하는 중 발생한 에러이다.

https://material.angular.io/components/datepicker/overview

 

import {default as _rollupMomentfrom 'moment'; 의 default 에서 빨간 밑줄이 그어지며 “moment” has no exported member 'default' 라는 에러가 출력되고 해결 방법은 아래와 같다.

 

tsconfig.json파일의 "compilerOptions" 에 "allowSyntheticDefaultImports"true, 한 줄을 추가한다.

 

 

 

 

출처 : https://stackoverflow.com/questions/54766706/moment-has-no-exported-member-default

728x90

댓글