Importing moment into Angular gives error

前端 未结 3 1846
独厮守ぢ
独厮守ぢ 2021-01-13 09:12

I am getting following error: Module \'\".../node_modules/moment/moment\"\' has no exported member \'default\'when I use

import * as _moment from

3条回答
  •  逝去的感伤
    2021-01-13 10:03

    From Moment's Docs:

    Note: If you have trouble importing moment, try adding "allowSyntheticDefaultImports": true in compilerOptions in your tsconfig.json file and then use the syntax

提交回复
热议问题