TypeError: Cannot read property ‘length’ of null

this is original blogger, shall not be reproduced without permission:

abnormal display:

[Vue warn]: Error in getter for watcher "filterAndSortData": "TypeError: Cannot read property 'length' of null"

found in

---> <UxTable>
       <UxCol>
         <UxRow>
           <CustomerDomainCofigDetail> at src/web/manage/customerManage/CustomerDomainCofigDetail.vue
             <ElMain>
               <ElContainer>
                 <MainAdmin> at src/web/manage/MainAdmin.vue
                   <App> at src/app.vue
                     <Root>
warn @ vue.esm.js?efeb:591
logError @ vue.esm.js?efeb:1737
globalHandleError @ vue.esm.js?efeb:1732
handleError @ vue.esm.js?efeb:1721
get @ vue.esm.js?efeb:3145
run @ vue.esm.js?efeb:3219
flushSchedulerQueue @ vue.esm.js?efeb:2981
(anonymous) @ vue.esm.js?efeb:1837
flushCallbacks @ vue.esm.js?efeb:1758
Promise.then (async)
microTimerFunc @ vue.esm.js?efeb:1806
nextTick @ vue.esm.js?efeb:1850
queueWatcher @ vue.esm.js?efeb:3068
update @ vue.esm.js?efeb:3209
notify @ vue.esm.js?efeb:697
reactiveSetter @ vue.esm.js?efeb:1014
proxySetter @ vue.esm.js?efeb:3300
(anonymous) @ CustomerDomainCofigDetail.vue?6300:488
Promise.then (async)
initData @ CustomerDomainCofigDetail.vue?6300:482
created @ CustomerDomainCofigDetail.vue?6300:627
callHook @ vue.esm.js?efeb:2921
Vue._init @ vue.esm.js?efeb:4630
VueComponent @ vue.esm.js?efeb:4798
createComponentInstanceForVnode @ vue.esm.js?efeb:4310
init @ vue.esm.js?efeb:4131
createComponent @ vue.esm.js?efeb:5608
createElm @ vue.esm.js?efeb:5555
updateChildren @ vue.esm.js?efeb:5845
patchVnode @ vue.esm.js?efeb:5936
patch @ vue.esm.js?efeb:6096
Vue._update @ vue.esm.js?efeb:2670
updateComponent @ vue.esm.js?efeb:2788
get @ vue.esm.js?efeb:3142
run @ vue.esm.js?efeb:3219
flushSchedulerQueue @ vue.esm.js?efeb:2981
(anonymous) @ vue.esm.js?efeb:1837
flushCallbacks @ vue.esm.js?efeb:1758
vue.esm.js?efeb:1741 TypeError: Cannot read property 'length' of null
    at recursiveRows (utils.js?8c28:43)
    at normalizeRows (utils.js?8c28:61)
    at VueComponent.normalizeData (table.js?7ae6:141)
    at Watcher.get (vue.esm.js?efeb:3142)
    at Watcher.evaluate (vue.esm.js?efeb:3249)
    at VueComponent.computedGetter [as normalizeData] (vue.esm.js?efeb:3507)
    at VueComponent.filterAndSortData (table.js?7ae6:180)
    at Watcher.get (vue.esm.js?efeb:3142)
    at Watcher.evaluate (vue.esm.js?efeb:3249)
    at VueComponent.computedGetter [as filterAndSortData] (vue.esm.js?efeb:3507)
logError @ vue.esm.js?efeb:1741
globalHandleError @ vue.esm.js?efeb:1732
handleError @ vue.esm.js?efeb:1721
get @ vue.esm.js?efeb:3145
run @ vue.esm.js?efeb:3219
flushSchedulerQueue @ vue.esm.js?efeb:2981
(anonymous) @ vue.esm.js?efeb:1837
flushCallbacks @ vue.esm.js?efeb:1758
Promise.then (async)
microTimerFunc @ vue.esm.js?efeb:1806
nextTick @ vue.esm.js?efeb:1850
queueWatcher @ vue.esm.js?efeb:3068
update @ vue.esm.js?efeb:3209
notify @ vue.esm.js?efeb:697
reactiveSetter @ vue.esm.js?efeb:1014
proxySetter @ vue.esm.js?efeb:3300
(anonymous) @ CustomerDomainCofigDetail.vue?6300:488
Promise.then (async)
initData @ CustomerDomainCofigDetail.vue?6300:482
created @ CustomerDomainCofigDetail.vue?6300:627
callHook @ vue.esm.js?efeb:2921
Vue._init @ vue.esm.js?efeb:4630
VueComponent @ vue.esm.js?efeb:4798
createComponentInstanceForVnode @ vue.esm.js?efeb:4310
init @ vue.esm.js?efeb:4131
createComponent @ vue.esm.js?efeb:5608
createElm @ vue.esm.js?efeb:5555
updateChildren @ vue.esm.js?efeb:5845
patchVnode @ vue.esm.js?efeb:5936
patch @ vue.esm.js?efeb:6096
Vue._update @ vue.esm.js?efeb:2670
updateComponent @ vue.esm.js?efeb:2788
get @ vue.esm.js?efeb:3142
run @ vue.esm.js?efeb:3219
flushSchedulerQueue @ vue.esm.js?efeb:2981
(anonymous) @ vue.esm.js?efeb:1837
flushCallbacks @ vue.esm.js?efeb:1758
vue.esm.js?efeb:591 [Vue warn]: Error in render: "TypeError: Cannot read property 'length' of null"

found in

---> <UxTable>
       <UxCol>
         <UxRow>
           <CustomerDomainCofigDetail> at src/web/manage/customerManage/CustomerDomainCofigDetail.vue
             <ElMain>
               <ElContainer>
                 <MainAdmin> at src/web/manage/MainAdmin.vue
                   <App> at src/app.vue
                     <Root>
warn @ vue.esm.js?efeb:591
logError @ vue.esm.js?efeb:1737
globalHandleError @ vue.esm.js?efeb:1732
handleError @ vue.esm.js?efeb:1721
Vue._render @ vue.esm.js?efeb:4546
updateComponent @ vue.esm.js?efeb:2788
get @ vue.esm.js?efeb:3142
run @ vue.esm.js?efeb:3219
flushSchedulerQueue @ vue.esm.js?efeb:2981
(anonymous) @ vue.esm.js?efeb:1837
flushCallbacks @ vue.esm.js?efeb:1758
Promise.then (async)
microTimerFunc @ vue.esm.js?efeb:1806
nextTick @ vue.esm.js?efeb:1850
queueWatcher @ vue.esm.js?efeb:3068
update @ vue.esm.js?efeb:3209
notify @ vue.esm.js?efeb:697
reactiveSetter @ vue.esm.js?efeb:1014
proxySetter @ vue.esm.js?efeb:3300
(anonymous) @ CustomerDomainCofigDetail.vue?6300:488
Promise.then (async)
initData @ CustomerDomainCofigDetail.vue?6300:482
created @ CustomerDomainCofigDetail.vue?6300:627
callHook @ vue.esm.js?efeb:2921
Vue._init @ vue.esm.js?efeb:4630
VueComponent @ vue.esm.js?efeb:4798
createComponentInstanceForVnode @ vue.esm.js?efeb:4310
init @ vue.esm.js?efeb:4131
createComponent @ vue.esm.js?efeb:5608
createElm @ vue.esm.js?efeb:5555
updateChildren @ vue.esm.js?efeb:5845
patchVnode @ vue.esm.js?efeb:5936
patch @ vue.esm.js?efeb:6096
Vue._update @ vue.esm.js?efeb:2670
updateComponent @ vue.esm.js?efeb:2788
get @ vue.esm.js?efeb:3142
run @ vue.esm.js?efeb:3219
flushSchedulerQueue @ vue.esm.js?efeb:2981
(anonymous) @ vue.esm.js?efeb:1837
flushCallbacks @ vue.esm.js?efeb:1758
vue.esm.js?efeb:1741 TypeError: Cannot read property 'length' of null
    at recursiveRows (utils.js?8c28:43)
    at normalizeRows (utils.js?8c28:61)
    at VueComponent.normalizeData (table.js?7ae6:141)
    at Watcher.get (vue.esm.js?efeb:3142)
    at Watcher.evaluate (vue.esm.js?efeb:3249)
    at VueComponent.computedGetter [as normalizeData] (vue.esm.js?efeb:3507)
    at VueComponent.spinClasses (table.js?7ae6:313)
    at Watcher.get (vue.esm.js?efeb:3142)
    at Watcher.evaluate (vue.esm.js?efeb:3249)
    at Proxy.computedGetter (vue.esm.js?efeb:3507)

the abnormal reason: due to initialize the data in the page is loaded, defines the data type, an array of initialization to get data from the background to the variable assignment, due to the background data returned is null, the error when I was assigned to the array,

the solution: at the time of assignment and a layer of judge and validation can solve null

Similar Posts: