Importing MomentJS is causing the following error:
ERROR in [...] Cannot invoke an expression whose type lacks a call signature. Type 'typeof moment' has no compatible call signatures.
How can I resolve this error?
The latest version of MomentJS now has defined types. Reinstall MomentJS without external typings. You should also avoid namespace-style import as such imports cannot be called or constructed and would cause a failure at runtime.
The way to go is traditional import:
import moment from 'moment';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With