---
schema_version: "1"
id: 6ffe02193da5b87e6ee373eba7ae0edc995d386edd46a7966c50e3f05f3d713a
title: Troubleshoot Issues Related to Lightning Web Security
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/lwc/lightning-components-security/guides/lws/lws-troubleshoot.md
canonical_url: https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-troubleshoot.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 42220c25dc508db4984eb25a95fedc0551f6784bcec5aab601d7bef1c2f69114
products:
  - Security for Lightning Components
  - lwc
---
# 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.

1. [Determine if LWS is enabled or disabled](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-is-enabled.md). If you suspect that the correct security architecture isn’t in effect, see [Delayed Enabling or Disabling of LWS](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-caching.md).

2. Eliminate common issues that can be related to LWS.

   - [Properties Evaluate as `undefined` in LWS](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-undefined.md)
   - [Static Resources with async Functions Behave Inconsistently](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-async.md)
   - [Cloned Objects Behave Differently in LWS Compared to Lightning Locker](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-clone-objects.md)

3. Ensure that you’re following the coding guidelines outlined in [Build Components to Work with Lightning Web Security](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-build-components.md).

   - [Avoid Mutating Objects](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-mutation-alternatives.md)
   - [Avoid Using Map Objects](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-map.md)
   - [Avoid Custom Properties on Standard JavaScript Objects](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-standard-objects.md)
   - [Specify a MIME Type for Blob Objects](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-mime.md)
   - [Script Tags Transformed to Fetch Calls](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-script-tags.md)
   - [Access to iframe Content in LWS](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-iframes.md)
   - [URL Protocol Schemes Allowed](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-url-schemes.md)
   - [Aura Endpoints Disallowed by LWS](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-aura-endpoints.md)
   - [Analytics Libraries Blocked by LWS](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-analytics.md)
   - [Salesforce Global Variables Blocked by LWS](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-restricted-globals.md)
   - [Third-Party Library Considerations for LWS](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-js.md)
   - [Local Storage Limitations](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-local-storage.md)
   - [Objects Passed Between Components Are Proxied](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-proxies.md)
   - [Understand How LWS Architecture Affects Component Performance](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-performance.md)

4. Be aware of how [LWS sanitizes HTML and SVG elements](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-sanitize.md).

5. Be aware of [LWS limitations](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-limitations.md).

If you try these troubleshooting techniques without success, you can [disable Lightning Web Security in scratch orgs](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-enable-scratch-orgs.md) and continue to troubleshoot. We recommend that you reenable Lightning Web Security as soon as possible.

**See Also**

- [Debug with Lightning Web Security Enabled](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-debug.md)
