could not find published track : livekit in nextjs

193 views Asked by At

i hope you're having a good day. I'm new to livekit and currently using it in my nextjs project and I'm facing a problem where a user connects, disconnects and then reconnects his track becomes undefined and I get this error:

enter image description here

the weired thing is if I make any change in my code and save it even if it's a console.log then the track appears. Any help is appreciated. Thanks!

1

There are 1 answers

0
lukasio On

Unfortunately track publications cannot persist across full reconnects. In order to make this easier to handle, the livekit client SDKs automatically republish the track for you, but the track publication will be a new publication. You'll have to query again on the participant with e.g. participant.getTrack(Track.Source.Camera)