I'm developing a LWC. As my component need to be used inside customer's pages, we need it to be cross namespace. Salesforce offers it with Lightning Web Security (LWS) enabled only. After enabling LWS, I find out that the cross-namespace exception on Salesforce mobile application. On Salesforce web app, I still can use it normally.

For detail, I can described it as below: I have create a sample package here with 2 simple LWC. I have installed the package on my org with LWC enabled. On my org, I created a custom LWC of my own (named testCrossNamespaceCmp) which used component from the package: testCrossNamespaceCmp.html template like:

<test_lwc_pkg-simple-control orginal-value=100></test_lwc_pkg-simple-control>

testCrossNamespaceCmp.js-meta.xml like:

<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">

testCrossNamespaceCmp.js code like

import { LightningElement } from 'lwc';
export default class TestCrossNamespaceCmp extends LightningElement {}

I also create a sample Lightning Web App (named testCrossNamespaceApp) with App Builder, drag and drop testCrossNamespaceCmp there. From Salesforce web app, I can open the testCrossNamespaceApp app normally from any browsers (even Safari on iOS or Chrome on Android).

From Salesforce mobile app, I cannot open the testCrossNamespaceApp app. It raises exception whenever opening with message as below. When disabling LWS, we can see this message on both Salesforce mobile and web app. When enable LWS, we still can see it on Salesforce mobile app. The error message:

A Component Error has occured! Error: Attempting to reference cross-namespace module test_lwc_pkg-simpleTextDisplay in c-testCrossNamespaceCmp Component: markup://c:testCrossNamespaceCmp . Caused by: Attempting to reference cross-namespace module test_lwc_pkg-simpleTextDisplay in c-testCrossNamespaceCmp AuraComponentService.convertDependency()@https://grapecity-1e-dev-ed.lightning.force.com/native/native/bootman?resource=https://static.lightning.force.com/na163/auraFW/javascript/QPQi8lbYE8YujG6og6Dqgw/aura_proddebug.js:53030:14 AuraComponentService.$evaluateModuleDef$()@https://grapecity-1e-dev-ed.lightning.force.com/native/native/bootman?resource=https://static.lightning.force.com/na163/auraFW/javascript/QPQi8lbYE8YujG6og6Dqgw/aura_proddebug.js:52964:34 AuraComponentService.$createInteropComponentDef$()@https://grapecity-1e-dev-ed.lightning.force.com/native/native/bootman?resource=https://static.lightning.force.com/na163/auraFW/javascript/QPQi8lbYE8YujG6og6Dqgw/aura_proddebug.js:53066:19 AuraComponentService.$getComponentDef$()@https://grapecity-1e-dev-ed.lightning.force.com/native/native/bootman?resource=https://static.lightning.force.com/na163/auraFW/javascript/QPQi8lbYE8YujG6og6Dqgw/aura_proddebug.js:53391:19 AuraComponentService.$getDef$()@https://grapecity-1e-dev-ed.lightning.force.com/native/native/bootman?resource=https://static.lightning.force.com/na163/auraFW/javascript/QPQi8lbYE8YujG6og6Dqgw/aura_proddebug.js:53419:18 AuraComponentService.$getComponentConfigs$()@https://grapecity-1e-dev-ed.lightning.force.com/native/native/bootman?resource=https://static.lightning.force.com/na163/auraFW/javascript/QPQi8lbYE8YujG6og6Dqgw/aura_proddebug.js:53325:14 Sorry to interrupt

Is it a known issue of Salesforce? Is there anything I can do here to use my app on Salesforce mobile app?

Thank you in advance!

  • UPDATE: I got no answer from community up to now. It looks like noone got the same issue or we don't have any solution at all. I'm asking Salesforce supporter about it and hope that we have a good answer/solution from them. I will update the original post with it too. If you know something or have related concern, let me know so I can ask them in advance. Thanks Sep 19, 2022 at 4:35
  • UPDATE: I got the answer from Salesforce as the issue is fixed. Actually, it's fixed in Winter'23, however, even Salesforce supporters don't know any more detail. Anyway, the issue just fixed. Dec 12, 2022 at 9:07


You must log in to answer this question.

Browse other questions tagged .