Service / Embedded Service
getViewSDK() Hangs Silently When lightning-ui-embedding Props Contain Arrays or Nested Objects
Summary
When using the lightning-ui-embedding component, passing arrays or nested objects through the props attribute causes the guest's getViewSDK() to hang indefinitely without resolving. No error is thrown or logged on either the host or guest side. The host fires sf-embedding.component.ready as expected, giving the impression that the component loaded successfully, but the guest never receives the SDK and remains stuck. The underlying cause is a DataCloneError that gets silently swallowed in the transport layer when postMessage attempts to serialize LWC read-only proxy objects.
Workaround
Serialize any array or nested object values to a JSON string before passing them as props to lightning-ui-embedding, then parse the string back on the guest side using JSON.parse().
Instead of: props = { Accounts: ['a', 'b', 'c'], name: 'test' }
Use: props = { Accounts: JSON.stringify(['a', 'b', 'c']), name: 'test' }
Steps to reproduce
- Deploy a wrapper LWC component using
<lightning-ui-embedding props={...}>where the props object contains an array or nested object — for example:{ Accounts: ['a', 'b', 'c'], name: 'test' }. - Open the component in a Salesforce org (reproduced on build 266).
- Mount the guest with simple scalar props such as
{ recordId, name }— the guest resolves successfully in approximately 79ms. - Mount the guest with array props such as
{ Accounts: ['a', 'b', 'c'], name }— the host firessf-embedding.component.ready, butgetViewSDK()remains pending indefinitely (observed hanging for 38+ seconds) with nothing logged in the browser console.
The following props shapes were all tested and result in a hang:
- Literal array
JSON.parse(JSON.stringify(list))structuredClone(list)- Class-instance wrapper (hangs inside an org; resolves only in a local repro outside an org)
Error details
Internally, postMessage throws a DataCloneError when attempting to serialize LWC read-only proxy objects containing arrays or nested objects. This error is caught and discarded by an empty try/catch block inside MessageChannelTransport.post in @salesforce/jsonrpc. As a result, getViewSDK() hangs indefinitely with no rejection, no timeout, and no console output. Any subsequent retry is rejected with the message: "ui-state subscription already active".
History
Description updated
Nov 30, 2026
First tracked here as Solution in Progress
Nov 30, 2026