Module 'moment' has no exported member 'UnitOfTime'
See original GitHub issueDescription of the Issue and Steps to Reproduce:
I’m getting the error ERROR in [default] /Users/max/project/node_modules/angular2-moment/difference.pipe.d.ts:4:91
when compiling my project.
Duplicate exists #91 but installing typescript definitions from typings, and from @types/moment did not fix the issue.
Please describe the issue and steps to reproduce, preferably with a code sample / plunker:
I’ve installed the pikaday datepicker that relies on the moment typescript definition file to export several classes, one of which is UnitOfTime.
As far as I can tell, my problem comes from the fact that the typescript definition file for moment included in angular2-moment doesn’t export UnitOfTime.
Environment:
- Angular version?
2.0.0-beta.5
- TypeScript version?
2.0.0
moment
version?
“moment”: “^2.15.0”,
- Are you using
moment-timezone
?
no
- Are you using the angular-cli?
np
- Using Rollup/Webpack/System.js/Ionic/similar?
webpack
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:15 (2 by maintainers)
Top GitHub Comments
+1
Reverting moment to 2.15.2 worked for us.
@chadbr If the definition changes and UnitOfTime is no longer valid, then that should be a major version bump as it’s a breaking change…
Ref: https://github.com/moment/moment/issues/3589