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
Gopal Singh 17Gopal Singh 17 

Uncaught (in promise) TypeError: t[Yn] is not a function

I am getting this error while iterating data under template tag in llightning web component.

<template>
        <lightning-card title="EventWithData" icon-name="standard:logging">
                <div class="slds-m-around_medium">
                        <template if:true={contacts.data}>
                            <p>Gopal Singh</p>
                            <template for:each={contacts} for:item='con'>
                                    <p key={con.id}>{con.Title}</p>
                                </template>
                        </template>
                    </div>
        
        </lightning-card>
    </template>


import { LightningElement, wire } from 'lwc';
import getContactList from '@salesforce/apex/ContactController.getContactList';
export default class EventWithData extends LightningElement {
    //@track selectedContact;
    @wire(getContactList) contacts;    
}
Khan AnasKhan Anas (Salesforce Developers) 
Hi Gopal,

Greetings to you!

Iterate over contacts.data. Please try below code:
<template>
        <lightning-card title="EventWithData" icon-name="standard:logging">
                <div class="slds-m-around_medium">
                        <template if:true={contacts.data}>
                            <p>Gopal Singh</p>
                            <template for:each={contacts.data} for:item='con'>
                                    <p key={con.id}>{con.Title}</p>
                                </template>
                        </template>
                    </div>
        
        </lightning-card>
    </template>

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas