Since updating to RC.0, I'm getting the following build error to do with moment.js (which I have installed via npm):
[13:44:16] Error: Cannot call a namespace ('moment')
I have tried referencing moment in two ways:
import * as moment from 'moment';
import moment from 'moment'
The error is the same.
Q) What am I doing wrong? This was working before RC.0
The people behind Moment. js are even advising against using it. We now generally consider Moment to be a legacy project in maintenance mode. It is not dead, but it is indeed done.
var CurrentDate = moment(). format();
js is a JavaScript package that makes it simple to parse, validate, manipulate, and display date/time in JavaScript. Moment. js allows you to display dates in a human-readable format based on your location.
Moment. js is a free and open source JavaScript library that removes the need to use the native JavaScript Date object directly.
With import * as Moment from 'moment';
I was getting the error: Cannot call a namespace ('Moment').
Changing it to import Moment from 'moment';
resolved the issue.
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