Uncaught ReferenceError: Strophe is not defined


#1

i face with this error "Uncaught ReferenceError: Strophe is not defined. ". I imported library. and applied appropriate steps that describe on guide. but stil

Uncaught ReferenceError: Strophe is not defined

    var options = {

        width: 700,
        height: 700,
        parentNode: document.querySelector('#meet')
    };

    JitsiMeetJS.init(options)
    var connection = new JitsiMeetJS.JitsiConnection(null, null, options);
    connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED, onConnectionSuccess);
    connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_FAILED, onConnectionFailed);
    connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED, disconnect);
    connection.connect();
    room = connection.initJitsiConference("conference1", confOptions);
    room.on(JitsiMeetJS.events.conference.TRACK_ADDED, onRemoteTrack);
    room.on(JitsiMeetJS.events.conference.CONFERENCE_JOINED, onConferenceJoined);
    JitsiMeetJS.createLocalTracks().then(onLocalTracks);
    room.join();

#2

Did you import also strophe as shown in the example: https://github.com/jitsi/lib-jitsi-meet/blob/master/doc/example/index.html ?


#3

i didnt it add as script tag into html. i have to do it? i am doing now wait me for respond.


#4

i added all these lines into index.html but still same error.

`

`

#5

I was testing the example few weeks ago and it was working just fine. Can you share your code to take a look.


#6

How can i share? if you want you can connect my pc via teamviawer? Or how can i share?


#7

for react component i imported this line.
import JitsiMeetJS from ‘lib-jitsi-meet’

and then inside component didmounth
i added:
var options = {

        width: 700,
        height: 700,
        parentNode: document.querySelector('#meet')
    };

    JitsiMeetJS.init(options)
    var connection = new JitsiMeetJS.JitsiConnection(null, null, options);
    connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED, onConnectionSuccess);
    connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_FAILED, onConnectionFailed);
    connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED, disconnect);
    connection.connect();
    room = connection.initJitsiConference("conference1", confOptions);
    room.on(JitsiMeetJS.events.conference.TRACK_ADDED, onRemoteTrack);
    room.on(JitsiMeetJS.events.conference.CONFERENCE_JOINED, onConferenceJoined);
    JitsiMeetJS.createLocalTracks().then(onLocalTracks);
    room.join();

inside package.json
“lib-jitsi-meet”: “^1.0.6”,

i added this line.

and lastly:

inside index.html i added all these lines:

https://cdnjs.cloudflare.com/ajax/libs/strophe.js/1.2.15/strophe.min.js
https://cdn.jsdelivr.net/npm/strophejs-plugin-disco@0.0.2/lib/strophe.disco.min.js
https://cdn.jsdelivr.net/npm/lib-jitsi-meet@1.0.6/dist/lib-jitsi-meet.min.js


#8

Take a look at jitsi-meet as an example. Don’t use that lib-jitst-meet version as it is not coming from the jitsi community and it is years old. Use the same stuff that jitsi-meet uses and it already is using the lib in react peoject.


#10

By the way i moved the cdn lines inside head tag. i face with this “Uncaught Error: Missing strophe-plugins (disco and caps plugins are required)!” error. you mean i have to change the import package? or should i need to delete it?


#11

by the way i can’t find lib-jitsi-meet.min.js this file.

i edit like that

<script src="lib-jitsi-meet/libs/strophe/strophe.js"></script>
<script src="lib-jitsi-meet/libs/strophe/strophe.disco.min.js?v=1"></script>
< scr ipt sr c=" https://cdn.jsdelivr.net/npm/lib-jitsi-meet@1.0.6/dist/lib-jitsi-meet.min.js"></scr ipt>
< sc ript src="lib-jitsi-meet/libs/exam ple.js" ></ scr ipt>

and error says me that :slight_smile:Error: Missing strophe-plugins (disco and caps plugins are required)!
at new a (lib-jitsi-meet.min.js:1)
at new l (lib-jitsi-meet.min.js:1)
at JitsiMeetJS.init.then (example.js:262)


#12

Don’t use this. This is two years old version and is not created from jitsi community.

You can use https://meet.jit.si/libs/lib-jitsi-meet.min.js


#13

thank you! by the way i had forgetten to read “To build the library, just type:” :frowning: really thank you for your interest!


#14

You can check the example.js: https://github.com/jitsi/lib-jitsi-meet/blob/master/doc/example/index.html
It includes both:

If you are using react and npm you can look at jitsi-meet as an example, you can do this and you don’t need to include those script tags:


#15

you mean. i just need to add this line to package json “lib-jitsi-meet”: “github:jitsi/lib-jitsi-meet#98acf1336df7a6fe6fc27c16c829ef607ec20ceb”,

and then npm install ?

so i need to import it to react component?


#16

You still need the script tag for lib-jitsi-meet: https://github.com/jitsi/jitsi-meet/blob/master/index.html#L137, but there is no strophe script tag at the moment in jitsi-meet, so you should be able to go without those, maybe the 2 years old lib was not including those…
Here is how the web uses lib-jitsi-meet in the react project: https://github.com/jitsi/jitsi-meet/blob/c7f374009950ed635ff1e4ef4e3b11c7e86e9a69/react/features/base/lib-jitsi-meet/_.web.js#L8


#17

Hmm. last one step i have.

const options = {
hosts: {
domain: ‘jitsi-meet.example.com’,
muc: ‘conference.jitsi-meet.example.com’ // FIXME: use XEP-0030
},
bosh: ‘//jitsi-meet.example.com/http-bind’, // FIXME: use xep-0156 for that

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

};

how could i edit this lines? can you describe it?

when i add appropriate script tag. my camera’s light suddenly opened. but i cant see any camera field although i have #meet div.


#18

I don’t understand your question, can explain what you mean.
This is simple config that you need to pass, that points to your deployment or any deployment.
What camera field do you want to have?


#19

i mean i did what you all said. but there is still error. I am on local machine.