Has anyone else used `moment` in their functions? ...
# prisma-whats-new
m
Has anyone else used
moment
in their functions? I get the follow error:
TypeError: moment_1.default is not a function
a
How are you importing it?
m
I was using
import moment from 'moment';
but I switched to
import * as moment from 'moment';
and it works
is it worth raising an issue on github?
a
It is not an issue is it?
m
import moment from 'moment';
is kind of the default way of importing right?
a
Not in Typescript
m
that's the way I use it across all my JS
arent the functions in JS or TS?
a
Are you using JS or TS?
m
JS
a
still, moment doesn't have a default export
m
oh okay
a
So it's not a GC issue
m
I'll leave this one then
👍🏻 1
thanks
a
By the way, you can also use https://www.npmjs.com/package/moment-es6, which does propertly export ES6 style, so you can do
import moment from 'moment-es6'
again.
👍 1
t
I use moment just fine. what is your issue?