Determine if LWS is Enabled
Sometimes, it can be hard to quickly determine if LWS is in use on your running code. Here are some techniques you can try.
In an Aura component’s JavaScript, add some code that triggers an LWS distortion. See the LWS Distortion Viewer for descriptions of LWS distortions.
Deploy the Aura component to your org to test.
The simplest approach is to check for a value returned by a distortion. For example, if this check returns true
, LWS is running, and the org is not excluded from LWS for Aura.
You can see an error in the browser developer console.
This approach uses your existing component code without modification. You can use it on code running in production.
In Chrome DevTools, look in the Sources tab’s Page panel and find the component JavaScript file in the folder your-org-domain/components/c
or your specific namespace if not using the c
namespace.
Don’t look for the JavaScript in the lws
folder. The lws
folder uses source mapping to remove the extra runtime code from view.
If you find these strings in the runtime component JS code, the org is running with LWS.
- LWC component
Search for the string
sandbox.evaluateInSandbox
- Aura component
Search for the string
$A.lockerService.createForDefNext