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
Noble Wong 2Noble Wong 2 

A Component Error has occurred! - Easy way to troubleshoot?

Is there an easy way to troubleshoot this? I'm doing the trailhead: https://trailhead.salesforce.com/en/content/learn/modules/lightning-web-components-and-salesforce-data/use-apex-to-work-with-data

And I made Contacts uppercase on purpose to create this error in contactList.js 

@wire(getContacts)
Contacts;

The resultant error message is very vague and doesn't really show where the error is... (I had to goto Sources tab of console and use the search feature to find the compiled js...).

Any way to figure out how to easily find syntax errors like this?

User-added image
AbhishekAbhishek (Salesforce Developers) 
Wong,

For all the Trailhead issues or Guidance please report it here,

https://trailhead.salesforce.com/en/help?support=home

https://trailhead.salesforce.com/help

So that our trailhead support engineers will look into it and get back to you.

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.

Regards,
Salesforce Support.
Noble Wong 2Noble Wong 2
Well, this isn't trailhead specific, as the trailhead has the correct code... This is a general Apex question on troubleshooting... What if I misspelled the data field, i.e. cntacts? Is there an easy way to find an error?
AbhishekAbhishek (Salesforce Developers) 
Wong,

Then the you have to use debug statements in the code or check debug logs while replicataing the issue.
David jack 12David jack 12
Hello,
This error showing that the problem in where you write contacts may be incorrect the spell then recheck it. Then it will work because of problems in the contacts data filed.
Thanks 
David jack
Sandip rajbharSandip rajbhar
I have a class that creates Tasks. When I go to the list view or the object page for those Tasks, if I click on Task Name field it links to Production  (https://indvox.com/)