otalk / jingle.js

A generic Jingle session manager implementation, suitable for integration by other XMPP libraries.
MIT License
89 stars 17 forks source link

Error: Cannot find module 'undefined' #2

Closed fraserxu closed 10 years ago

fraserxu commented 10 years ago

Hi @legastero I'm trying to use jingle.js in my project, but my app is not using any module system, so I just use the jingle.bundle.js file and include it in my html header.

But when I try to create a new jingle instance with var jingle = new Jingle(), it returns me this:

Error: Cannot find module 'undefined'

Do you have idea about this?

fraserxu commented 10 years ago

Also, I've included attachMediaStream in the header, and I can get the attachMediaStream function from the chrome dev tool just as what described in the readme file:

If you're not using browserify or you want AMD support use attachmediastream.bundle.js. Note that if no module system is detected it simply attaches a function called attachMediaStream to window.

But not sure why jingle.js doesn't work for me.

legastero commented 10 years ago

Not entirely sure what the issue was, but updating browserify and rebuilding the bundle seems to have solved it.

fraserxu commented 10 years ago

Yes. I just tried to use the raw file from your github repo directly again and no error anymore. But I don't understand why it doesn't work for me when I build it locally by myself. I'm using browserify 3.0.0 btw.

fraserxu commented 10 years ago

Hmm, I see. It's because the build script read module from the ./node_modules folder.

Problem solved, thanks!