11

The new Lightning Web Security model that is set to overtake Lightning Locker is not working the way the SF docs explain. In short: I do not have an 'lws' folder.

From developer.salesforce.com:

When your components run in an org where Lightning Web Security is enabled, look for the lws folder near the bottom of the Page pane. Expand the folder and see your component files organized under their namespace folder. screen capture from SF Dev Docs Here you see the c namespace and its components on the current page (1). The same compositionBasics.js file with LWS enabled is shown with source mapping (2).

I can only see the source code under top/components/c as I show below, but, my F12 Developer tools do not allow me to set breakpoints anywhere

my F12 Dev tools Screenshot

I feel like it did work breifly at one point for me, but I have to disable LWS to do any kind of debugging currently. Anyone else experiencing this?


UPDATE 1:


I think perhaps there's something about my home network causing this.

The 'lws' folder does indeed appear as advertised if I debug from my work-provided workstation (I remote into it), but it does NOT work from Chrome or Edge on my home workstation (I turned off my work VPN, thinking it was the culprit, but still no luck)


UPDATE 2:


Even on my work PC, although the lwc folder displays - the breakpoints do not hit unless I put a debugger; statement in the script, and even then, it doesn't seem be hitting in the correct spots.

3

2 Answers 2

4

This behavior is also happening to me.

I just throw a debugger; in the js file and from there you can debug on web.

2
  • 2
    Thanks Raul. I've been doing JS dev for decades, and had never tried the debugger; trick. It does help somewhat.
    – bkwdesign
    Commented Jan 25, 2023 at 16:28
  • 1
    This was working last month, something has changed which has broken this functionality. If its a dev org or scratch org then you can switch off LWS and debugging works again
    – MikeO
    Commented Jan 31, 2023 at 8:48
4

Debugging Lightning Web Components (LWC) on orgs with Lightning Web Security (LWS) enabled is working for non-LWR digital experiences, and "CRM"/internal users.

For LWR experiences there is a bug: Lightning Web Components breakpoints are not working while debugging Experience LWR sites with Lightning Web Security enabled. The solution is work in progress.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .