Error Strophe: ReferenceError: b64_sha1 is not defined


#1

Hi everyone!
We set up a quick config to test jitsi, we manage to connect to a server where jitsi is deployed. But when joining the room, an error occurs which is Strophe: ReferenceError: b64_sha1 is not defined.

We are using React, we yarn add lib-jitsi-meet and then added and imported ‘strophe.js’, ‘strophejs-plugin-caps’, ‘strophejs-plugin-disco’, and jquery.

As you can see, we initiate a connection in the componentDidMount

componentDidMount() {
const options = {
  hosts: {
    domain: 'XXXXX.xxxx.io',
    muc: 'conference.XXXXXX.xxxxx.io', // FIXME: use XEP-0030
  },
  bosh: 'https://XXXXXX.xxxxx.io/http-bind', // FIXME: use xep-0156 for that

  // The name of client node advertised in XEP-0115 'c' stanza
  clientNode: 'http://jitsi.org/jitsimeet',
};

JitsiMeetJS.init({ disableAudioLevels: true });

connection = new JitsiMeetJS.JitsiConnection(
  'XXXXX',
  'XXXXX',
  options,
);

connection.addEventListener(
  JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED,
  this.connectionSuccess,
);
connection.addEventListener(
  JitsiMeetJS.events.connection.CONNECTION_FAILED,
  this.connectionFailed,
);
connection.addEventListener(
  JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED,
  this.disconnect,
);

connection.connect();

}

On connection success the following function is triggered

connectionSuccess = () => {
const confOptions = {
  openBridgeChannel: true,
};

const room = connection.initJitsiConference('conference1', confOptions);

room.join();
console.log('Success');

};

but we end up in the browser console with this kind of error, which seems to come from the inner of lib-jitsi-meet.min

If it rings a bell, we would really appreciate a feed back!


#2

Please use lib-jitsi-meet straight from GitHub. We don’t do releases, and what you see on npm is an old version someone submitted.


#3

Thank you @saghul for your quick reply. We actually managed to pass this error by letting go of the npm version!