Skip to main content

Hi All, 

 

I am debugging a custom Lightning Web Component in Chrome DevTools. 

 

When Lightning Web Security is enabled, the component appears under: lightning/n/components/c/sampleRecordViewer.js 

 

instead of: lightning/n/modules/c/sampleRecordViewer.js 

 

When I disable Lightning Web Security and perform an Empty Cache and Hard Reload, the component appears under the expected modules/c path. 

 

The component works correctly in both cases. Lightning Debug Mode and JavaScript source maps are enabled. 

 

Why does this happen when Lightning Web Security is enabled? Is this expected behavior or a source-mapping issue? Is there a way to debug the component under modules/c without disabling Lightning Web Security? 

 

Thanks 

 

 

#Salesforce Developer  #LWC

4 Antworten
  1. 28. Okt., 08:50

    Hi Ajit, good point. The docs describe the typical path, but the folder DevTools shows depends on how the component was loaded. Likely causes are an older cached copy or a different loader path in your org's release, so I can't promise it will always match the docs. Please try a hard reload in an incognito window with the cache disabled, then press Ctrl/Cmd+P and search sampleRecordViewer.js. If it still shows under components/c, your code is still the unminified source, so debugging works there. Please also share your release and browser version, and if the path never changes, a Salesforce Support case is worth opening.

0/9000