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

Fix TypeError: moment is not a function #2228

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Nov 9, 2021

  1. Fix TypeError: moment is not a function

    Hey, I have been using Vitejs and Vue3. I was getting the following error while using your npm library.
    
    "TypeError: moment is not a function"
    
    It appears when inserted into the vitejs build, the library tries to use 'moment' however it receives an object instead of moment, the object contains a 'default' property that is the actual moment method.
    
    I've added a check when the package is built via vitejs to check if moment is not a function and whether it has a default property, and if so, override moment with moment.default and continue as usual.
    
    This change fixed the error on our project.
    
    Thanks in advance for this awesome library.
    arifsaygili committed Nov 9, 2021
    Configuration menu
    Copy the full SHA
    1aa9949 View commit details
    Browse the repository at this point in the history