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
Sandeep EkambeSandeep Ekambe 

Account Record data using APEX wire LWC cannot be inserted in a recordpage

Created a LWC to display Account Record data using the APEX wire method, after pushing the code to the scratch org, created a new Lightning Account record page, was trying to drag and drop the above LWC onto this page but this throws below error 
User-added image

Below is the code

.js code
import { LightningElement, wire } from 'lwc';
    import getAccountList from '@salesforce/apex/GetAccountData.getAccountList';
     
    export default class LWCWireEx extends LightningElement {
        @wire(getAccountList) accounts;
    }

.html code
<template>
            <lightning-card title="Apex Class Example(lWCWireEx compo)" icon-name="custom:custom63">
                    <div class="slds-m-around_medium">
                        <template if:true={accounts.data}>
                            <template for:each={accounts.data} for:item="acc">
                                <p key={acc.Id}>{acc.Name}</p>
                            </template>
                        </template>
                        
                    </div>
                </lightning-card>
        </template>


GetAccountData.cls APEX code
public with sharing class GetAccountData {
       @AuraEnabled(cacheable=true)
        public static List<Account> getAccountList() {
            return [SELECT Id, Name,Type,Rating,Phone FROM Account];
        }
    }