triniwiz / nativescript-socketio

Socket.IO for nativescript
Apache License 2.0
71 stars 31 forks source link

ReferenceError: io is not defined #29

Closed agrawal-mohit closed 8 years ago

agrawal-mohit commented 8 years ago

files.zip I've create a chat component in my project and using this library to communicate with a web socket server.

This is the stacktrace when I run the app:

java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: 

[files.zip](https://github.com/triniwiz/nativescript-socketio/files/579281/files.zip)

Error calling module function 

Error calling module function 

Error calling module function 

Error calling module function 

ReferenceError: io is not defined
File: "/data/data/org.nativescript.groceries/files/app/tns_modules/nativescript-socketio/socketio.js, line: 2, column: 14

StackTrace: 
    Frame: function:'', file:'/data/data/org.nativescript.groceries/files/app/tns_modules/nativescript-socketio/socketio.js', line: 2, column: 15
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'/data/data/org.nativescript.groceries/files/app/pages/chat/chat.component.js', line: 14, column: 16
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'/data/data/org.nativescript.groceries/files/app/app.module.js', line: 17, column: 24
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'/data/data/org.nativescript.groceries/files/app/main.js', line: 3, column: 20
    Frame: function:'require', file:'', line: 1, column: 266
triniwiz commented 8 years ago

did you call the .connect() method ?

agrawal-mohit commented 8 years ago

@triniwiz No, where am i supposed to call it ?

triniwiz commented 8 years ago

yes and you can check out https://github.com/triniwiz/nativescript-socketio/blob/master/demo/app/login.ts#L19