Open soullivaneuh opened 4 years ago
If I install the net
package and run tns run android
(not build), now I get:
System.err: TypeError: Cannot read property 'env' of undefined
System.err: at com.tns.Runtime.runModule(Native Method)
System.err: at com.tns.Runtime.runModule(Runtime.java:674)
System.err: at com.tns.Runtime.run(Runtime.java:666)
System.err: at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
System.err: at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1119)
System.err: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5740)
System.err: ... 8 more
And the error is gone if I remove the import.
I'm not sure I have to install the net module by the way, I don't have to on web dev.
I also opened https://github.com/feathersjs/feathers/issues/1843, I'm not very sure what should be fixed here.
@soullivaneuh did the suggested fix resolve your issue?
I think it would be something like this:
import feathers from '@feathersjs/client'
import feathersSocketIO from '@feathersjs/socketio-client'
var SocketIO = require('nativescript-socketio').SocketIO;
var socket = new SocketIO('http://localhost:3030', { transports: ['websocket'] })
// let hasConnectedOnce = false
const feathersClient = feathers()
.configure(feathersSocketIO(socket))
Which platform(s) does your issue occur on?
Please, provide the following version numbers that your issue occurs with:
Please, tell us how to recreate the issue in as much detail as possible.
Import Feathers socket io client on one of your pages:
And run
tns build android
You will get this error:
It's maybe FeathersJS related only, but I'm not sure and would like to know what you, native expert, thing about this issue.
Is there any code involved?
Here is a PR coming from a fresh svelte-native template: https://github.com/soullivaneuh/svelte-native-test/pull/2