Skip to content
Log in

Enable Lightning Web Security for StoreConnect

On this page

Overview

StoreConnect uses dynamic imports in its Lightning Web Components (LWC). Salesforce only allows dynamic imports when Lightning Web Security (LWS) is enabled in the org. If LWS is not enabled, the StoreConnect package installation will fail.

:::warning If Lightning Web Security is not enabled, the StoreConnect package installation will fail with the error LWC1503: Dynamic imports are not allowed. You must complete this step before attempting to install StoreConnect from AppExchange. :::

Note that LWS is an org-wide setting that Salesforce recommends for all orgs. Enabling it should not affect your existing components or apps, but it could. If you find this is the case, you will need to switch off LWS and resolve the issue in the affected app before retrying.

Prerequisites

Steps

Step 1: Open session settings

  1. Log in to Salesforce as a System Administrator.
  2. Click the gear icon and select Setup.
  3. In the Quick Find box, type Session Settings.
  4. Select Session Settings from the results.

Step 2: Enable Lightning Web Security

  1. Scroll down to the Lightning Web Security section.
  2. Check the box for Use Lightning Web Security for Lightning web components and Aura components.
  3. Click Save.

Step 3: Clear your browser cache

After enabling LWS, clear your browser cache. The setting can take a couple of minutes to take effect across the org.

:::note Lightning Web Security is an org-wide setting. It replaces the older Lightning Locker security architecture. Salesforce recommends LWS for all orgs and will eventually enforce it across all orgs, so enabling it now is something that will need to happen regardless. :::

Verification

  1. Return to Setup > Session Settings and confirm the Use Lightning Web Security for Lightning web components and Aura components checkbox is still enabled.
  2. Retry the StoreConnect package installation from AppExchange. The LWC1503 error should no longer appear.

Frequently asked questions

What is Lightning Web Security?

Lightning Web Security (LWS) is Salesforce’s modern browser-based security architecture for Lightning components. It replaces the older Lightning Locker and enables features such as dynamic imports, which StoreConnect requires.

Will enabling LWS affect my existing components?

LWS is backward compatible with most components. Salesforce provides a compatibility tool in Setup to check for any potential issues. For more details, refer to the Salesforce LWS documentation. If you find that your other apps or components are impacted, you may need to switch off LWS and resolve the issue in your other apps before switching it on again.

I already attempted the install and got the LWC1503 error. What do I do?

Enable LWS using the steps above, clear your browser cache, and then retry the StoreConnect package installation from AppExchange. No data or setup information in your org is affected by a failed installation attempt.

Was this article helpful?

Was this article helpful?