Lightning Out嵌入复杂Salesforce Screen Flow时出现组件连接错误求助
Lightning Out嵌入复杂Salesforce Screen Flow时字段加载失败问题
基础的2屏Screen Flow通过Lightning Out嵌入外部Web应用可正常运行,但加载复杂流程时出现以下错误,仅能看到流程按钮,无法显示流程内字段:
Screen Flow Error:
This page has an error. You might just need to refresh it. Error during LWC component connect phase: [Error in $A.getCallback() [Cannot read properties of null (reading 'getReference')]] Failing descriptor: {markup://flowruntime:auraField}
相关代码
Aura Component
auraScreenFlow.cmp
<aura:component> <aura:handler name="init" value="{!this}" action="{!c.init}" /> <lightning:flow aura:id="flowScreen" /> </aura:component>
auraScreenFlowController.js
({ init : function(component) { var flow = component.find("flowScreen"); flow.startFlow("flow_api_name"); } })
Lightning Application
auraScreenFlowApplication.app
<aura:application access="GLOBAL" extends="ltng:outApp" implements="ltng:allowGuestAccess"> <aura:dependency resource="c:auraScreenFlow" /> </aura:application>
Web Application HTML
index.html
<div id="flow"></div> <script src="https://myorg.lightning.force.com/lightning/lightning.out.js"></script> <script> $Lightning.use('c:auraScreenFlowApplication', function () { $Lightning.createComponent( 'c:auraScreenFlow', {}, "flow", function (cmp) { console.log('Created', { cmp }); } ); }, 'https://myorg.lightning.force.com/', 'access-token' ); </script>
已完成的配置
- 创建了Connected App
- 在Org的CORS设置中添加了
https://localhost:8081 - Web应用本身运行正常,可加载Lightning App
请说明该错误的原因及修复方法。
内容的提问来源于stack exchange,提问作者Rohan Thakur
相关产品推荐
相关产品推荐

