Getting "Cannot read properties of undefined (reading '_navigate')" error sometimes when initiating our Jitsi server video call from our integrated application

Hi Team,

When we are trying to open a video consultation from our integrated application using IFrame API using our Jitsi video server, we are getting the below error. Sometimes it opening fine but sometimes its giving the below error.

Logger.js:154 2022-10-06T11:49:56.326Z [JitsiMeetJS.js] <Object.getGlobalOnErrorHandler>: UnhandledError: Cannot read properties of undefined (reading ‘_navigate’) Script: null Line: null Column: null StackTrace: TypeError: Cannot read properties of undefined (reading ‘_navigate’)
** at https://.com/libs/app.bundle.min.js?v=5818:138:737693**
r @ Logger.js:154
middleware.js:154 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘_navigate’)
** at middleware.js:154:48**
Logger.js:154 2022-10-06T11:49:56.327Z [JitsiMeetJS.js] <Object.getGlobalOnErrorHandler>: UnhandledError: Cannot destructure property ‘id’ of ‘$p(…)’ as it is undefined. Script: null Line: null Column: null StackTrace: TypeError: Cannot destructure property ‘id’ of ‘$p(…)’ as it is undefined.
** at Object.changeLocalDisplayName (https://
***.com/libs/app.bundle.min.js?v=5818:138:558897)

Our Jitsi application has been deployed in ubuntu server. And when we are testing it with meet.jit.si from our application…its working fine without any issues.

Kindly help us here what changes we can make in the configuration to resolve the above error.


Regards,
Usha.

At what point you are trying to set the display name?

And please do not randomly mention people if they are not already helping you, thank you.

Hi @damencho,

Apologies and sure, will follow the same. Just mentioned thought i would get quick response.

But that is the error visible on the screenshot …

This error is different… its showing as below:

Cannot read properties of undefined (reading ‘_navigate’) Script: null Line: null Column: null StackTrace: TypeError: Cannot read properties of undefined (reading ‘_navigate’)

We are getting this error when we are trying to open a video consultation from our integrated application.

Hi @damencho ,

Did you mean this error from the screenshot?

Uncaught (in promise) TypeError: Cannot destructure property ‘id’ of ‘$p(…)’ as it is undefined.
** at Object.changeLocalDisplayName (conference.js:3086:17)**
** at display-name (API.js:140:28)**
** at API.js:554:22**

We are calling the jitsi server by using the below code in which ‘displayName’ also included.

var  domain= "*********";
const options = {
                roomName: channelName,
                width: 571,
                height: 615,
                parentNode: document.querySelector('#dvJistiVideo'),
                interfaceConfigOverwrite: { HIDE_INVITE_MORE_HEADER: true },

           };
        const jistiApi = new JitsiMeetExternalAPI(domain, options);
            jistiApi.resizeLargeVideo(1000, 1000);
            jistiApi.addEventListener('participantLeft', participantLeft);
            jistiApi.addEventListener('videoConferenceLeft', leaveJistiChannel);
        jistiApi.addEventListener('readyToClose', readyToClose);
        jistiApi.executeCommand('subject', ' ');
        jistiApi.executeCommand('displayName', displayName);
       }

You should probably be using the userInfo option instead. So

const options = {
    roomName: channelName,
    // ...
    userInfo: {
       displayName: displayName,
    }
 };

I’m wondering if you might be calling this too soon. Perhaps only call in after conference is set up, e.g.

jistiApi.addListener('videoConferenceJoined', function() {
   jistiApi.executeCommand('subject', ' ');
});

Also, I believe the ‘subject’ command will attempt to set the subject for the whole conference so it may not make sense for every user to set it, especially when it will only work for moderators. If you want to set it on every user, perhaps consider the ‘localSubject’ command instead.