dayjs icon indicating copy to clipboard operation
dayjs copied to clipboard

TypeError: dayjs_1.default is not a function

Open rogerprz opened this issue 3 years ago • 2 comments

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 avatar Oct 14 '21 17:10 rogerprz

@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 :)

linkurzweg avatar Jan 21 '22 14:01 linkurzweg

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

swimhiking avatar Mar 28 '24 17:03 swimhiking