-
[day.js] TypeError 0 dayjs_1 default is not a functionerror 2023. 6. 15. 16:43
I figured it out, it was because I imported the "relativeTime" extension in my entry point but didn't import it where I was using it. I just assumed that it would work at the entry point but moving it right next to the code in question fixed it:
import dayjs from "dayjs" import relativeTime from "dayjs/plugin/relativeTime" dayjs.extend(relativeTime) console.log(dayjs(new Date("jan 1, 2020").fromNow())'error' 카테고리의 다른 글