xlsdg / vue-countup-v2

Vue.js component wrap for countUp.js
https://inorganik.github.io/countUp.js/
MIT License
379 stars 56 forks source link

Unexpected Identifier in nuxt #15

Open divyadave95 opened 5 years ago

divyadave95 commented 5 years ago

unexpected

acidjazz commented 5 years ago

just ran into this myself, any update @divyadave95 ?

acidjazz commented 5 years ago

@divyadave95 this is because this does not support server-side mode, change your plugin file from countup.js to countup.client.js and your problem should be solved, you can close this @xlsdg

I think a nuxt.js plugin example on the readme.md would be nice

acidjazz commented 5 years ago

here is mine which is working fine

import Vue from 'vue'
import ICountUp from 'vue-countup-v2/dist/VueCountUp'
Vue.component('ICountUp', ICountUp)
BuddhiAbeyratne commented 4 years ago

sadly doesn't work any longer

chrisleekr commented 4 years ago

For those who need a workaround, I had succeeded by adding both 'countup.js', and 'vue-countup-v2' in nuxt.config.js

build: {
    /*
     ** You can extend webpack config here
     */
    transpile: ['countup.js', 'vue-countup-v2'],
    extend(_config, _ctx) {}
  },
heyepeng commented 4 years ago

For those who need a workaround, I had succeeded by adding both 'countup.js', and 'vue-countup-v2' in nuxt.config.js

build: {
    /*
     ** You can extend webpack config here
     */
    transpile: ['countup.js', 'vue-countup-v2'],
    extend(_config, _ctx) {}
  },

It works,thx!

hariavers commented 3 years ago

This Works for nuxt:

build: { transpile: ['countup.js', 'vue-countup-v2'], extend(_config, _ctx) {} },