Troubleshoot Issues Related to Lightning Web Security
Developers can sometimes encounter some issues when developing and testing components to run in Lightning Web Security (LWS). Follow these troubleshooting steps, and check whether your issue is addressed within these topics.
-
Determine if LWS is enabled or disabled. If you suspect that the correct security architecture isn't in effect, see Delayed Enabling or Disabling of LWS.
-
Eliminate common issues that can be related to LWS.
-
Ensure that you're following the coding guidelines outlined in Build Components to Work with Lightning Web Security.
- Avoid Mutating Objects
- Avoid Using Map Objects
- Avoid Custom Properties on Standard JavaScript Objects
- Specify a MIME Type for Blob Objects
- Script Tags Transformed to Fetch Calls
- Access to iframe Content in LWS
- URL Protocol Schemes Allowed
- Aura Endpoints Disallowed by LWS
- Analytics Libraries Blocked by LWS
- Salesforce Global Variables Blocked by LWS
- Third-Party Library Considerations for LWS
- Local Storage Limitations
- Objects Passed Between Components Are Proxied
- Understand How LWS Architecture Affects Component Performance
-
Be aware of how LWS sanitizes HTML and SVG elements.
-
Be aware of LWS limitations.
If you try these troubleshooting techniques without success, you can disable Lightning Web Security in scratch orgs and continue to troubleshoot. We recommend that you reenable Lightning Web Security as soon as possible.
See Also