Is it possible to turn on Debug Mode for Lightning Components for a guest/anonymous/not signed in user?
When I go to Setup -> Custom Code -> Lightning Components -> Debug Mode, I cannot see the "Guest User" user in the list of users.
You can set the UserPreferencesUserDebugModePref
field on the Guest User to enable lightning component debug mode, e.g.
$ sfdx force:data:record:update -s User -i 005... -v "UserPreferencesUserDebugModePref=true"
If you want to debug Lightning components from Client end, then you can directly open up Chrome Developer Tools by "Ctrl + Shift + I" in windows.
Then select the Sources
tab and then open the component name you want to debug.
If LWC then you need to prettify the code and keep breakpoints directly here, if its aura then no need to prettify.
You can checkout this too. Debug Javascript
If the debug is on Apex side, then you can start the debug logs on "Site's Guest User : user".