Failed to load Jitsi Meet API - Error in lib-jitsi-meet during initJitsiConference (TypeError: Cannot read property ‘substr’)

Hi friends,

I’m trying to use the Jitsi Meet API to create Jitsi Meet video conferences with custom GUI.

I’m receiving a Uncaught TypeError: Cannot read property 'substr' of null when calling initJitsiConference() .
I get the following error message:

JitsiConference.js:276 Uncaught (in promise) TypeError: Cannot read property ‘substr’ of null
at se.resourceCreator (JitsiConference.js:276)
at A.createRoom (xmpp.js:481)
at se._init (JitsiConference.js:310)
at new se (JitsiConference.js:130)
at c.initJitsiConference (JitsiConnection.js:113)
at VideoCallService.onConnectionSuccess (videoCall.js?169b:271)
at VideoCallService.setConnectionListeners (videoCall.js?169b:472)
at eval (videoCall.js?169b:430)

Looking at JitsiConference.js:276 i see this:

image

My script looks like this:

const initOptions = {
disableAudioLevels: false,
desktopSharingChromeExtId: ‘mbocklcggfhnbahlnepmldehdhpjfcjp’,
desktopSharingChromeDisabled: false,
desktopSharingChromeSources: [‘screen’, ‘window’],
desktopSharingChromeMinExtVersion: ‘0.1’,
desktopSharingFirefoxDisabled: true,
};
const options = {
serviceUrl: ‘https://meet.jit.si/http-bind’,
hosts: {
domain: ‘meet.jit.si’,
muc: ‘conference.meet.jit.si’,
},
};

JitsiMeetJS.init(this.initOptions);
this.connection = new JitsiMeetJS.JitsiConnection(null, null, this.options);

this.connection.addEventListener(
  JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED,
  this.onConnectionSuccess(),
);

onConnectionSuccess(){
this.room = this.connection.initJitsiConference(
‘conference’,
this.confOptions,
);
this.room.join();
this.room.MyUserId();
console.log(‘CONNECTION_ESTABLISHED’);
}

Thanks in advance for any comment!