dayjs
dayjs copied to clipboard
TypeError: dayjs_1.default is not a function
Describe the bug Similar to this https://github.com/iamkun/dayjs/issues/475
TypeError: dayjs_1.default is not a function
controls: 20 | },
controls: 21 | 'RollupEstActiveUsers': 1,
controls: > 22 | 'EstCompletionDate': dayjs('1111-11-11'),
Expected behavior For my tests to pass and not consider dayjs to not be a function.
Information
- Day.js Version 1.10.7
- OS: MacOs and Windows
- Browser Chrome 94.0.4606.7
- Time zone: (Pacific Daylight Time)
@rogerprz I had the same problem, for me the solution was to explicitly import the isBetween plugin every time before using it in a file (like stated in the docs):
import isBetween from 'dayjs/plugin/isBetween'
dayjs.extend(isBetween)
Now my jest test runs just fine :)
I have isBetween, and all unit tests works, now I have add new dayjs.extend, then always not working; got TypeError: (0 , dayjs_1.default) is not a function or TypeError: dayjs_1.default.extend is not a function error;
code is working, just unit tests not working