Loading

Scoped Imports Are Not Allowed Using Lightning Locker.

Publiseringsdato: Oct 1, 2024
Beskrivelse
Scoped imports are not allowed in custom LWC components whenever the component uses the runtime namespace tag in the LWC XML file.
Løsning

This is a known limitation of Lightning locker. The new Lightning Web Security architecture aims to replace Lightning Locker for Lightning web components. It works along with Lightning Locker, which is still used for Aura components.
Official Documentation

Lightning Web Security supports:

  • Cross-namespace component use
  • Interactions with global objects
  • Improved performance
  • Better support of third-party JavaScript
  • Compatibility with standard JavaScript as it evolves


**Note
Because Lightning Web Security is a beta quality feature, it is strongly recommended that it is enabled it in a sandbox staging environment first. If testing shows that the components are working well in the sandbox staging environment, then users can turn it on in a production org.

Also this can be disabled by deselecting the setting: Lightning Locker for LWC under Setup---->Session Settings https://developer.salesforce.com/docs/platform/lwc/guide/security-lwsec-locker-comparison.html
To report issues, give feedback, and ask questions about the Lightning Web Security beta: https://sfdc.co/NextGenWebSecurity.

 

Knowledge-artikkelnummer

000395260

 
Laster
Salesforce Help | Article