1. 程式人生 > >前端報錯排查小結,報錯資訊:uncaught TypeError: Cannot read property '設計師序號' of undefined

前端報錯排查小結,報錯資訊:uncaught TypeError: Cannot read property '設計師序號' of undefined

                                                                        前端報錯排查小結

時間:2018-9-5

專案:財務計算工具

實現功能:前端顯示一個訂單表,要有合計和具體清單資料,用兩個集合巢狀迴圈來合成資訊;一個集合是清單另一個是合計的內容,期設計師的序號是主建,顯示時要求連個集合中設計師序號排列順序一直;

前端報錯:uncaught TypeError: Cannot read property '設計師序號' of undefined

程式碼、報錯見圖片附件

排查:關鍵詞undefined是未定義或為找到,次報錯理解為設計師序號前面的元素未定義或找不到;

           檢視錯誤程式碼位置發現時內迴圈的下標為找到,即下標越界;在前端列印兩個集合的設計師序號看到第一個集合序號錯亂沒有排序,導致和內迴圈的設計師序號不能對應,不能同時結束迴圈,內迴圈顯示完了,外循還要繼續顯示,到顯示內迴圈時期內沒有資料找出集合下標越界報錯;在查詢外迴圈資料的SQL語句加入order by排序後顯示正常!

總結:報錯資訊抓住關鍵詞,undefined意為設計師序號前面的元素未定義為找到。

相關推薦

前端排查小結資訊uncaught TypeError: Cannot read property '設計師序號' of undefined

                                                                        前端報錯排查小結 時間:2018-9-5 專案:財務計算工具 實現功能:前端顯示一個訂單表,要有合計和具體清單資料,用兩個

EasyUI datagridUncaught TypeError: Cannot read property 'width' of null

採用EasyUI的 datagrid 展示資料,報錯:Uncaught TypeError: Cannot read property ‘width’ of null 解決辦法: columns引數寫法錯誤,該引數有兩個[],少寫會報該錯誤。 columns:[[ {field:‘c

誤碼Uncaught TypeError: Cannot read property 'field' of undefined

錯誤碼:Uncaught TypeError: Cannot read property ‘field’ of undefined 具體錯誤資訊: Uncaught TypeError: Cannot read property 'field' of undefined

使用form的方法(例如resetclear等)Uncaught TypeError: Cannot read property 'tip' of undefined(…)的原因

 在瀏覽器中debug前端程式碼時,第一次按一個按鍵,沒有問題,第二次開始再按這個按鍵的時候,出現了錯誤Uncaught TypeError: Cannot read property 'tip' of undefined(…),雖然不影響功能,但是出現紅色的錯誤總是感覺

jQuery mobile Uncaught TypeError: Cannot read property 'concat' of undefined

typeerror html error 錯誤 query doctype src mobile scrip 寫一個jQuery mobile的demo <!DOCTYPE html> <html> <head>

ExtJS Uncaught TypeError: Cannot read property 'parentNode' of null

ext-all.js:21 Uncaught TypeError: Cannot read property 'parentNode' of null     at A.updateColumns (ext-all.js:21)     at A.onUp

【原創】My97DatePicker Uncaught TypeError: Cannot read property 'length' of null 分析

公司ui前端框架的日曆外掛使用的是第三方的My97DatePicker,在使用過程中,為了滿足日期格式化的要求 寫了下面兩種寫法 下面這樣展示 “年-月-日 時:分:秒” 是正常,且無報錯 但是換個格式,下面這個是"時分秒"的格式就有問題 報錯如下: VM3

前臺:Uncaught TypeError: Cannot read property '0' of null

錯誤現象: var div1=mycss[0].style.backgroundColor;  //這一行提示360和chrome提示:Uncaught TypeError: Cannot read property '0'&nb

ionic3_ion-slideUncaught TypeError: Cannot read property 'hasAttribute' of undefined

在使用ion-slide時報錯Uncaught TypeError: Cannot read property 'hasAttribute' of undefined,經檢查發現是由於陣列資料沒有值的原

Vue的Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'

pac rop space efault type require bject default logs 剛剛運行一下以前的一個Vue+webpack的demo,運行之後沒有出現想象中的效果,並且報錯 Uncaught TypeError: Cannot assign t

vueError in render: "TypeError: Cannot read property '0' of undefined"

通常有兩種情況: 1、在模板的html標籤上使用length報錯 vue 中使用 length判斷的時候,有時會報錯,如下: <div class="item_list" v-if="form.checkVal.length > 0" >列表1</div><div c

VueUncaught TypeError: Cannot assign to read only property’exports‘ of object’#[Object]‘的解決方法

發現問題 1,執行一下以前的一個Vue+webpack的 vue仿新聞網站  小專案,報錯 由於自己vue學習不深入,老是這個報錯,找了好久(確切的說是整整一下午^...^)才找到原因 -v- 2,點開錯誤的檔案,標註錯誤的地方是這樣的一段程式碼: 就是&n

TypeError: Cannot read property 'parentNode' of null

我是在迴圈的時候報的這個錯,後來解決的話是            如果不是以下的問題可以重新賦值來做。 JSON.parse(JSON.stringify(this.moreImageList)) 序列化然後在轉化為物件,因為剛開始的

Element UI級聯選擇器"TypeError: Cannot read property 'getElementsByClassName' of undefined"

  當點選的時候第一層出現的報錯(導致二級出不來) 原因: value 和 label的值未正確指定, 此處value並不存在options資料中 解決:  修改為:

axios 在 webpack 打包Uncaught (in promise) TypeError: Cannot read property 'protocol' of undefined

解決方法: import axios from 'axios' // 在這裡不能使用 Vue.use(axios) // Vue.use(axios) Vue.prototype.$http = axios 模組引用: // 基於vue的

vue 解決TypeError: Cannot read property '_t' of undefined"

前端報錯如下: [Vue warn]: Error in render: “TypeError: Cannot read property ‘_t’ of undefined” 是在專案中用了多語言配置,vue 跟 i18n之間的相容問題。解決方法如下:

VueUncaught TypeError: Cannot assign to read only property’exports‘ of object’#<Object>‘的解決方法

oid 方法 ids mlu efault 允許 mod gii ack 因為webpack 2中不允許混用import和module.exports , 解決辦法就是統一改成ES6的方式編寫即可. import { copyDeep } from ‘@/lib

TypeError: Cannot read property 'gc' of undefined 使用百度地圖

這種錯誤很有可能是因為在呼叫外部介面需要一點點時間來渲染頁面 直接使用的話一點緩衝的時間都沒有   解決辦法:只需

vue.js中報 TypeError: Cannot read property 'indexOf' of undefined

[Vue warn]: Error when evaluating expression "name.indexOf('jack') >= 0": TypeError: Cannot read

支付寶小程式setDataTypeError: Cannot read property 'setData' of undefined問題

我在onLoad函式中用this.setData重置了一個數值,然後就一直報錯,結果如下 問題原因: 無法找到setData這個定義,因為setData中是onLoad函式中的方法中的子節點, 無法使用this 解決方法 這個時候需要在方法的開始部分定義var