1

I've ran into an unexpected error in my lightning component and am trying to figure out where its happening/what's causing it so I can fix it. I must have skipped this section when learning Salesforce development because I really have no idea how to set up debug logs and determine what line is causing the error. Its a complicated Apex Controller so I don't think I can just use the Execute Anonymous Window. Any tips out there on how to set up the logs and then view them to find the line causing the error?

Thanks!

3

You're on the right track. If you open the Developer Console first, then run your lightning component, then in the debug log section you'll begin to see entries, one for each time that the component reaches out to the server. You can double-click on each entry to view its contents.

If the issue isn't on the server side, you can always use console.log() statements within the component to determine what the data was like before it failed.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.