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
Alex Waddell 18Alex Waddell 18 

Component error on Trailhead Geolocation app

Hello,

I am completing the Develop an Account Geolocation App with Aura Components Trail on Trailhead and though my components are functioning properly, every time I write something in the search bar (to query accounts) i get the following error

User-added image
The error seems to be coming from the following controller in the "AccountMapController" class
 
({
    onAccountsLoaded: function( component, event, helper ) {
        var mapMarkers = [];
        var accounts = event.getParam( 'accounts' );
        for ( var i = 0; i < accounts.length; i++ ) {
            var account = accounts[i];
            var marker = {
                'location': {
                    'Street': account.BillingStreet,
                    'City': account.BillingCity,
                    'PostalCode': account.BillingPostalCode
                },
                'title': account.Name,
                'description': (
                    'Phone: ' + account.Phone +
                    '<br/>' +
                    'Website: ' + account.Website
                ),
                'icon': 'standard:location'
            };
            mapMarkers.push( marker );
        }
        component.set( 'v.mapMarkers', mapMarkers );
    }
})

The issue seems to be with this accounts.length; 
What is length? it is not a custom field? is it the size of the Accounts list?

Any help to prevent this error would be great. I am trying to adapt this for my business


 
VinayVinay (Salesforce Developers) 
Hi,

Greetings!

We have separate Trailhead team who can help you with these issues.So,can you please use the below link to reach out to them so that one of the agent will get in touch with you.

Support:https://trailhead.salesforce.com/help

Thank 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.

Thanks,
Vinay Kumar