[system] TypeError: Cannot read property ‘name’ of undefined
This error occurs because some of the attributes in your curly brackets are undefined
1. Wrong attribute name
2. Another case: when the data is obtained asynchronously, there is no such data attribute during initialization
in my case, case 2, the value of the string is relatively deep, and the definition is only one level up
value structure:
{ "id": 105, ... "dealer": { "sn": null, "password": null, "name": "xx", "departmentSn": null, }, ... },
<view class="content-row">
<text class="cause">待处理:</text>
<text class="cause-detail" v-if="claim_detail_basic_list" >{{claim_detail_basic_list.dealer.name}}</text>
</view>
This side has done error prevention processing
v-if="claim_detail_basic_list"
Because the value object has to be further “claim”_ detail_ basic_ List. Dealer. Name ”
chunk-vendors.js:3874 [Vue warn]: Error in render: "TypeError: Cannot read property 'name' of undefined"
The solution can go one step further.
<view class="content-row">
<text class="cause">ToDoList:</text>
<text class="cause-detail" v-if="claim_detail_basic_list.dealer" >{{claim_detail_basic_list.dealer.name}}</text>
</view>
{{claim_ detail_ basic_ List. Dealer. Name}
OK! Reason: the deep object was not created and there was no attribute of the object when it was initialized.
Read More:
- [Solved] Syntax Error: TypeError: Cannot read property ‘parseComponent‘ of undefined
- [Solved] electron Error: Uncaught TypeError: Cannot read property ‘BrowserWindow‘ of undefined
- [Solved] Syntax Error: TypeError: Cannot read property ‘parseComponent‘ of undefined
- [Solved] TYPEERROR: CANNOT READ PROPERTY ‘REDUCE‘ OF UNDEFINED
- [Solved] Vue Error: TypeError: Cannot read property ‘end‘ of undefined
- [Solved] Install The Latest Version of Jest Error: TypeError: Cannot read property ‘instrument‘ of undefined
- Echarts Partially introduced error: TypeError: Cannot read property ‘findAxisModel’ of undefined
- [Solved] Uni.createintersectionobserver Error: Uncaught TypeError: Cannot read property ‘bottom’ of null
- Vue cannot read property ‘xxx’ of undefined solutions
- Cannot read property ‘isFile‘ of undefined [How to Solve]
- [Vue warn]: Error in render: “TypeError: Cannot read properties of undefined
- [Solved] Syntax Error: TypeError: Cannot set property ‘parent‘ of undefined
- [Vue warn]: Error in render: “TypeError: Cannot read properties of undefined
- [Solved] Cannot read property ‘setCheckedKeys‘ of undefined“
- [Solved] Vue element UI form verification error: cannot read property ‘validate’ of undefined
- [Solved] HBuilder Error: Cannot read property ‘forceUpdate‘ of undefined
- JS bug Log Uncaught TypeError: Cannot read property ‘previoustSibling‘ of null
- [Solved] vue.esm.js?efeb:591 [Vue warn]: Error in event handler for “click“: “TypeError: Cannot read property
- [Solved] vue watch Error: Error in callback for watcher “xxx“: “TypeError: Cannot read properties of undefined …
- [Solved] Element form method Error: TypeError: Cannot read properties of undefined (reading ‘resetFields’)