NathanaelA / nativescript-websockets

Websockets for NativeScript
83 stars 43 forks source link

Cannot read property 'client' of undefined #74

Closed venkyabburi closed 4 years ago

venkyabburi commented 4 years ago

LOG from device Abburi: Angular is running in the development mode. Call enableProdMode() to enable the production mode. LOG from device Abburi: ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'client' of undefined LOG from device Abburi: at Module../app/home/home.component.ts (file:///data/data/org.nativescript.preview/files/app/2.js:53:81) LOG from device Abburi: at webpack_require__ (file:///data/data/org.nativescript.preview/files/app/runtime.js:751:30) LOG from device Abburi: at fn (file:///data/data/org.nativescript.preview/files/app/runtime.js:121:20) LOG from device Abburi: at Module../app/home/home-routing.module.ts (file:///data/data/org.nativescript.preview/files/app/2.js:13:73) LOG from device Abburi: at Object.../node_modules/nativescript-websockets/websockets.js (file:///data/data/org.nativescript.preview/files/app/vendor.js:584:37) LOG from device Abburi: at fn (file:///data/data/org.nativescript.preview/files/app/runtime.js:121:20) LOG from device Abburi: TypeError: Cannot read property 'client' of undefined LOG from device Abburi: at webpack_require (file:///data/data/org.nativescript.preview/files/app/runtime.js:751:30) LOG from device Abburi: at webpack_require__ (file:///data/data/org.nativescript.preview/files/app/runtime.js:751:30) LOG from device Abburi: at fn (file:///data/data/org.nativescript.previ...

mrwhy-orig commented 4 years ago

I'm having the same problem here. I have to admit that I am new to nativescript.

I installed the Plugin V1.5.4 by the tns plugin add command. Then I imported the module in my Basic Vue template and run the app by using tns preview.

I've seen #37 but couldn't get it working, probably because my lag of nativescript knowledge. I added the suggestions to my app.gradle which didn't help in any way.

mrwhy-orig commented 4 years ago

Ok... Found it... no native modules in preview app ... makes sense...

NathanaelA commented 4 years ago

NativeScript PREVIEW cannot support Websockets! You must either do a cloud build or a local build; Preview cannot use native "compiled" modules of which NS-Websocket is one of them...