Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: dayjs_1.default is not a function #1667

Open
rogerprz opened this issue Oct 14, 2021 · 2 comments
Open

TypeError: dayjs_1.default is not a function #1667

rogerprz opened this issue Oct 14, 2021 · 2 comments

Comments

@rogerprz
Copy link

rogerprz commented Oct 14, 2021

Describe the bug
Similar to this #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)
@linkurzweg
Copy link

linkurzweg commented Jan 21, 2022

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

@swimhiking
Copy link

swimhiking commented Mar 28, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants