You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.20 22:06:35