This message was deleted.
# helpdesk
s
This message was deleted.
b
I suspect that this bug could be related to the issue: https://github.com/livekit/components-js/issues/524 I get the 'error while running updatePages()' error message in the situation that's described in the link, but also when I switch to the screen sharing after pinning. If I share the screen right away (without pinning), the error does not appear and the screen share works as intended.
a
Are you running the Meet app? or, if not, which Components are you using?
b
We adapted it from here: https://github.com/livekit/components-js Using VideoConference and ParticipantTile
The error is thrown in the 'useVisualStableUpdate' hook, and looks like this: Error while running updatePages(): Error: Element not part of the array: 'localUserId_camera_TR_VCBysiTy66obcA' not in '[remoteUserId_camera_placeholder, localUserId_screen_share_TR_VSg9wuVhRLLb3B]' or sometimes: Error while running updatePages(): Error: Element not part of the array: 'localUserId_camera_TR_VCBysiTy66obcA' not in '[remoteUserId_pov2_camera_TR_VCdHymFE62sM4w, localUserId_screen_share_TR_VSg9wuVhRLLb3B]'
a
Thanks, we’ll look into it (cc @eager-zoo-16408 )
👍 1
b
Ofc this error might not be the cause, but a symptom of the actual core issue (as was the case in another, closed issue that I reviewed)
e
Hey @broad-oil-45047, I'm not sure I can reproduce what you describe. Here are my steps: • Go to https://meet.livekit.io/rooms/gqp6-pk44 • Pin my camera tile. • Share my screen. -> The screen is automatically pinned and my camera is in the sidebar. • Pinning and unpinning the screen share or camera tile does not cause any visible problems. Are these the steps you have taken? What version of @livekit/components-react are you running?
b
It works for me via your link as well. So it seems that the problem is likely with our custom configuration. Our version is listed as "@livekit/components-react": "^1.4.0"
We'll try to update to the latest version and investigate what we've changed. I'll update here if we resolve the issue or not
👍 1
This issue was recently resolved by my colleague, who removed this block from ParticipantTile:
const trackReference: TrackReferenceOrPlaceholder = React.useMemo(() => {
return {
participant: trackRef?.participant ?? maybeTrackRef?.participant ?? p,
source: trackRef?.source ?? maybeTrackRef?.source ?? source,
publication: trackRef?.publication ?? maybeTrackRef?.publication ?? publication,
};
}, [maybeTrackRef, p, publication, source, trackRef]);
...and used only:
const trackReference = const trackReference = trackRef || maybeTrackRef
And in FocusLayout, he passed
trackRef={trackRef}
directly as a prop. Apparently the cause was some kind of context mixup. Here is his comment: "This PR removes the TrackRefContextIfNeeded from the ParticipantTile component. ParticipantTile is intended to be used as a child of the TrackLoop component which already adds the TrackRefContext or by passing a track reference as a property." (We now do the latter.) I'm not sure how this bug could exist only for us, since by default those parts are included in the standard components; we've made minimal modifications. But in any case the fix works.