naderio / nativescript-socket.io

Fully-featured Socket.IO client implementation for NativeScript
The Unlicense
48 stars 21 forks source link

IO is not defined #40

Closed thiagomotta closed 6 years ago

thiagomotta commented 6 years ago

Hello, I have the same problem. I already uninstall app my device, but a keep getting: "IO is not defined"

"nativescript-socket.io": "^0.9.0"

I need help, please Thanks :D

naderio commented 6 years ago

@thiagomotta is this still an issue?

andreicon commented 6 years ago

Confirmed this still an issue

An uncaught Exception occurred on "main" thread.
java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: 

Error calling module function 

Error calling module function 

ReferenceError: io is not defined
File: "file:///data/data/org.nativescript.myapp/files/app/tns_modules/nativescript-socket.io/socketio.js, line: 17, column: 15

StackTrace: 
    Frame: function:'', file:'file:///data/data/org.nativescript.myapp/files/app/tns_modules/nativescript-socket.io/socketio.js', line: 17, column: 16
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'file:///data/data/org.nativescript.myapp/files/app/app.js', line: 12391, column: 16
    Frame: function:'require', file:'', line: 1, column: 266

ReferenceError: io is not defined
File: "<unknown>, line: 1, column: 265

StackTrace: 
    Frame: function:'', file:'file:///data/data/org.nativescript.myapp/files/app/tns_modules/nativescript-socket.io/socketio.js', line: 17, column: 16
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'file:///data/data/org.nativescript.myapp/files/app/app.js', line: 12391, column: 16
    Frame: function:'require', file:'', line: 1, column: 266

ReferenceError: io is not defined
File: "<unknown>, line: 1, column: 265

StackTrace: 
    Frame: function:'', file:'file:///data/data/org.nativescript.myapp/files/app/tns_modules/nativescript-socket.io/socketio.js', line: 17, column: 16
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'file:///data/data/org.nativescript.myapp/files/app/app.js', line: 12391, column: 16
    Frame: function:'require', file:'', line: 1, column: 266

    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5406)
    at android.app.ActivityThread.-wrap2(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6119)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: com.tns.NativeScriptException: 

Error calling module function 

Error calling module function 

ReferenceError: io is not defined
File: "file:///data/data/org.nativescript.myapp/files/app/tns_modules/nativescript-socket.io/socketio.js, line: 17, column: 15

StackTrace: 
    Frame: function:'', file:'file:///data/data/org.nativescript.myapp/files/app/tns_modules/nativescript-socket.io/socketio.js', line: 17, column: 16
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'file:///data/data/org.nativescript.myapp/files/app/app.js', line: 12391, column: 16
    Frame: function:'require', file:'', line: 1, column: 266

ReferenceError: io is not defined
File: "<unknown>, line: 1, column: 265

StackTrace: 
    Frame: function:'', file:'file:///data/data/org.nativescript.myapp/files/app/tns_modules/nativescript-socket.io/socketio.js', line: 17, column: 16
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'file:///data/data/org.nativescript.myapp/files/app/app.js', line: 12391, column: 16
    Frame: function:'require', file:'', line: 1, column: 266

ReferenceError: io is not defined
File: "<unknown>, line: 1, column: 265

StackTrace: 
    Frame: function:'', file:'file:///data/data/org.nativescript.myapp/files/app/tns_modules/nativescript-socket.io/socketio.js', line: 17, column: 16
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'file:///data/data/org.nativescript.myapp/files/app/app.js', line: 12391, column: 16
    Frame: function:'require', file:'', line: 1, column: 266

    at com.tns.Runtime.runModule(Native Method)
    at com.tns.Runtime.runModule(Runtime.java:530)
    at com.tns.Runtime.run(Runtime.java:522)
    at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:19)
    at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5403)
    ... 8 more
thiagomotta commented 6 years ago

@andreicon and @naderio My solution was to create another application and I had no more problems

Thanks

arkenstan commented 6 years ago

I am still getting this issue when using feathers socket io client. @feathersjs/socketio-client requires property io which is not available in nativescript-socket.io

martineca commented 6 years ago

Still getting the issue here as well. Also, the demo example is not compiling.

alereisan commented 6 years ago

We solved it simply by doing: $ tns platform remove android $ tns platform add android