hootlex/vuejs-paginator

Error in created hook: "TypeError: Cannot read property 'get' of undefined"

terdia opened this issue ยท 4 comments

any idea why I am getting this error - [Vue warn]: Error in created hook: "TypeError: Cannot read property 'get' of undefined"

found in

--->

warn @ vue@2.3.4:440
handleError @ vue@2.3.4:525
callHook @ vue@2.3.4:2562
Vue._init @ vue@2.3.4:3994
VueComponent @ vue@2.3.4:4163
createComponentInstanceForVnode @ vue@2.3.4:3516
init @ vue@2.3.4:3350
createComponent @ vue@2.3.4:4895
createElm @ vue@2.3.4:4838
createChildren @ vue@2.3.4:4966
createElm @ vue@2.3.4:4871
createChildren @ vue@2.3.4:4966
createElm @ vue@2.3.4:4871
patch @ vue@2.3.4:5337
Vue._update @ vue@2.3.4:2320
updateComponent @ vue@2.3.4:2443
get @ vue@2.3.4:2780
Watcher @ vue@2.3.4:2763
mountComponent @ vue@2.3.4:2447
Vue$3.$mount @ vue@2.3.4:7565
Vue$3.$mount @ vue@2.3.4:9664
Vue._init @ vue@2.3.4:4004
Vue$3 @ vue@2.3.4:4089
xxx.siteCourseSearch.chronology @ all-2fcfe3235d.js:36261
(anonymous) @ all-2fcfe3235d.js:36400
i @ all-2fcfe3235d.js:2
fireWith @ all-2fcfe3235d.js:2
ready @ all-2fcfe3235d.js:2
vue@2.3.4:529 TypeError: Cannot read property 'get' of undefined
at VueComponent.fetchData (vuejs-paginator.min.js:1)
at VueComponent.boundFn [as fetchData] (vue@2.3.4:171)
at VueComponent.created (vuejs-paginator.min.js:1)
at callHook (vue@2.3.4:2560)
at VueComponent.Vue._init (vue@2.3.4:3994)
at new VueComponent (vue@2.3.4:4163)
at createComponentInstanceForVnode (vue@2.3.4:3516)
at init (vue@2.3.4:3350)
at createComponent (vue@2.3.4:4895)
at createElm (vue@2.3.4:4838)

I was having a similar issue and I solved it by installing vue-resource package. Since I am using Vue Single File Components, I did the installation via npm:

npm install vue-resource --save

After that I just imported it in my main.js and called Vue.use:

import VueResource from 'vue-resource';

Vue.use(VueResource)

I have not had the time to check it out, but I suppose that the paginator uses vue-resource for making the http calls.

I am having this issue also. I think the cdn approach is broken. Is there a way to fix it to use the cdn method?

@CamiloManrique you are right, it seems that the paginator relies on vue-resource. This dependency should be replaced by axios. At the time I created this component almost every project doing ajax requests used to use vue-resource.

@joer80 I'll release a new version on cdn soon.

I fixed mine by just adding a cdn link to a vue-resource file to the same page. :D

<script src="https://cdn.jsdelivr.net/npm/vue-resource@1.3.4"></script>