Can i use a Lightning Web Component from another Package/Namespace?

Im developing a couple of components and i have 2 different namespaces (for project reasons), i tried to use the component form namespace b on my component on namespace a although i can save and it compiles fine, when the page loads i get this error

Attempting to reference cross-namespace module gui_utl-fileExplorer in
gui_tkt-workOrderFileExplorer

I know with Aura components you can define access=”global” but i cant find the way to do it on LWC if there is.

BTW: My Both my components are exposed true

Answer

Based on this document, it seems like you can’t:
https://developer.salesforce.com/docs/component-library/documentation/lwc

Limits A custom Lightning web component can’t access a Lightning web component or module in a custom namespace. It can access Lightning
web components and modules only in the c and lightning namespaces.

Attribution
Source : Link , Question Author : Bruno Diaz , Answer Author : BritishBoyinDC

Leave a Comment