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

Cannot redefine property: $moment #134

Open
vince015 opened this issue Mar 15, 2020 · 1 comment
Open

Cannot redefine property: $moment #134

vince015 opened this issue Mar 15, 2020 · 1 comment

Comments

@vince015
Copy link

Getting this error: Cannot redefine property: $moment

<script>
import Vue from 'vue';
Vue.use(require('vue-moment'));
...
</script>

version: 4.1.0

@stewartmckee
Copy link

I had the same issue, in my case a vue component I have written as npm module uses VueMoment and then the host app also uses VueMoment, which ever is loaded last gets the error. In my case I have worked around with the following:

if (!Vue.moment) {
  Vue.use(VueMoment)
}

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

2 participants