Third-Party Library Strict Mode With LWS

If a third-party library script explicitly sets "use strict", the browser can throw errors when your components use the script while running in LWS.

For example, errors occur if the script attempts to set something in the global object. LWS implicitly enforces most strict mode restrictions, but allows writing to virtual global objects in its JavaScript sandboxes. Setting strict mode explicitly interferes with LWS.

The workaround is to remove "use strict" in the third-party script.

Alternatively, modify the third-party code to assign self to global.