function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Justin BreseeJustin Bresee 

Why am I getting this error: This page has an error. You might just need to refresh it. afterRender threw an error in 'c:siteExaminers_v2' [Cannot read property 'Name' of undefined] Failing descriptor: {c:siteExaminers}

I am trying to create a lightning component that pulls some contacts from my salesforce. 

Here is the HTML
<template for:each={examiners.data} for:item='examiner'>
    <tr key={examiner.Id}>
        <th>{examiner.Name}</th>
        <th>{examiner.Title}</th> 
        <th>{examiner.Account.Name</th>
    </tr>
</template>

Here is the javascript
 
import { LightningElement, wire } from 'lwc';
import getSiteExaminers from '@salesforce/apex/Dynamic_Pages.getSiteExaminers';

export default class SiteExaminers extends LightningElement {

    @wire(getSiteExaminers) examiners;
}

and the error I am getting is: This page has an error. You might just need to refresh it. afterRender threw an error in 'c:siteExaminers_v2' [Cannot read property 'Name' of undefined] Failing descriptor: {c:siteExaminers}
AmarpreetAmarpreet
Hi Justin, 

Try below code:
 
<template if:true={examiners.data}>
<template for:each={examiners.data} for:item='examiner'>
    <tr key={examiner.Id}>
        <th>{examiner.Name}</th>
        <th>{examiner.Title}</th> 
        <th>{examiner.Account.Name</th>
    </tr>
</template>
<</template>