Giter Club home page Giter Club logo

nativescript-sse's Introduction

NativeScript Server Sent Events

npm npm Build Status

A NativeScript client for the Server Sent Events (SSE).

Install

npm install nativescript-sse

Usage

import { SSE } from 'nativescript-sse';

let sse = new SSE(serverApi: string, headers: object);
sse.events.on('onConnect', (data) => {
    console.log(data.object.connected);
});
sse.events.on('onMessage', (data) => {
    this.list.push(JSON.parse(data.object.message.data))
});
sse.events.on('onError', (data) => {
    console.log(data.object.error);
});
see.close();

nativescript-sse's People

Contributors

1u0n avatar logikgate avatar triniwiz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nativescript-sse's Issues

Plugin doesn't seem to work for cellular connection (4G or 3G)

Make sure to check the demo app(s) for sample usage

Make sure to check the existing issues in this repository

If the demo apps cannot help and there is no issue for your problem, tell us about it

Please, ensure your title is less than 63 characters long and starts with a capital
letter.

Which platform(s) does your issue occur on?

  • iOS/Android/Both
  • iOS/Android versions
  • emulator or device. What type of device?

Please, provide the following version numbers that your issue occurs with:

  • CLI: (run tns --version to fetch it)
  • Cross-platform modules: (check the 'version' attribute in the
    node_modules/tns-core-modules/package.json file in your project)
  • Runtime(s): (look for the "tns-android" and "tns-ios" properties in the package.json file of your project)
  • Plugin(s): (look for the version numbers in the package.json file of your
    project and paste your dependencies and devDependencies here)

Please, tell us how to recreate the issue in as much detail as possible.

Describe the steps to reproduce it.

Is there any code involved?

  • provide a code example to recreate the problem
  • (EVEN BETTER) provide a .zip with application or refer to a repository with application where the problem is reproducible.

Hi Triniwiz,

First of all, thanks for the plugin, it's really helpful.

When testing with WIFI connection on IOS, the plugin works very fine. My issue is when turning to 4G connection, no events are received from the server. Have you already encountered this kind of issue? if yes, how did you manage to fix it?

Thanks a lot.

Err: Failed resolving constructor for class com.tylerjroach...

Which platform(s) does your issue occur on?

  • iOS/Android/Both Android. Works fine on iOS
  • iOS/Android versions 11
  • emulator or device. What type of device? Pixel 2 XL

Please, provide the following version numbers that your issue occurs with:

  • CLI: (run tns --version to fetch it) 8.0.1
  • Cross-platform modules: (check the 'version' attribute in the
    node_modules/tns-core-modules/package.json file in your project) no such file/folder
  • Runtime(s): (look for the "tns-android" and "tns-ios" properties in the package.json file of your project) 7.0.1
  • Plugin(s): (look for the version numbers in the package.json file of your
    project and paste your dependencies and devDependencies here) default dependencies from a new project with ns create

Please, tell us how to recreate the issue in as much detail as possible.

On Android, trying to instantiate an SSE object using the example code let sse = new SSE(serverApi: string, headers: object); results in an error:

java.lang.Exception: Failed resolving constructor for class 'com.tylerjroach.eventsource.EventSourceHandler' with 0 parameters. Check the number and type of arguments. 

To reproduce:

ns create ns-sse-sample

Choose "Angular"
Choose "Hello World"

cd ns-sse-sample/

npm install --save nativescript-sse

cat <<EOF > src/app/app.component.ts
import { Component, OnInit } from "@angular/core";
import { SSE } from 'nativescript-sse';

@Component({
    selector: "ns-app",
    templateUrl: "./app.component.html"
})
export class AppComponent implements OnInit {

  constructor() { }
  ngOnInit(): void {
    let sse = new SSE('https://anywhere');
    sse.events.on('onConnect', (data: any) => {
        console.log(data.object.connected);
    });
    sse.events.on('onMessage', (data: any) => {
        console.log(JSON.parse(data.object.message.data))
    });
    sse.events.on('onError', (data: any) => {
        console.log(data.object.error);
    });
    sse.close();
  }
}
EOF

ns run android

Here is a ZIP of the project the above creates: ns-sse-sample.zip

When page loads, error is logged to console and no SSE is connected.

Is there any code involved?

let sse = new SSE(serverApi: string, headers: object);

Thanks for the great library!

Error: Cannot read property 'on' of undefined.

Hi,
Trying to use this module in Nativescript and it gives the error: Cannot read property 'on' of undefined.

I fixed it by adding the line:

this.events = new observable_1.Observable();

between lines 8 and 9 of sse.android.js

specs.
version used: npm install nativescript-sse
node version: 7.3.0
npm version: 4.1.1
nativescript-sse version: 2.0.0

Can't find variable: EventSource

Which platform(s) does your issue occur on?

tns preview

Please, provide the following version numbers that your issue occurs with:

  • CLI: 6.3.3
  • Cross-platform modules: 6.3.2
  • Runtime(s): iOS:6.3.0 Android:6.3.1
  • Plugin(s): See below:
  "dependencies": {
    "@nativescript/theme": "~2.2.1",
    "nativescript-sse": "^4.0.2",
    "tns-core-modules": "~6.3.0"
  },
  "devDependencies": {
    "nativescript-dev-webpack": "~1.4.0",
    "typescript": "~3.5.3"
  },

Please, tell us how to recreate the issue in as much detail as possible.

I've tried installing the demo with the above setup. npm fails to install the dependencies. I've also tried to import it from a blank app tns create my-app-name --template typescript

Is there any code involved?

https://github.com/jaredwolff/nativescript-sse-fail

Stack trace

LOG from device iPhone: 2020-01-21 14:41:00.897 nsplaydev[35018:10289250] PlayLiveSync: openURL
2020-01-21 14:41:00.898 nsplaydev[35018:10289250] PlayLiveSync: Starting application using url nsplay://restart?pKey=pub-c-d7893276-cc78-4d18-8ab0-becba06e43de&sKey=sub-c-3dad1ebe-aaa3-11e8-8027-363023237e0b&instanceId=1uhaBqFNw&template=play-ng&hmr=1
2020-01-21 14:41:00:909 nsplaydev[35018:10289250] <Logger::com.pubnub.pubnub-objc> File logger enabled.
2020-01-21 14:41:00:909 nsplaydev[35018:10289250] <Logger::com.pubnub.pubnub-objc> Log files stored in: /var/mobile/Containers/Data/Application/C4626E8C-6DAD-4854-9228-AEC11CB2D8C6/Documents/Logs/com.pubnub.pubnub-objc.
2020-01-21 14:41:00:910 nsplaydev[35018:10289250] <Logger::com.pubnub.pubnub-objc> Disk quota changed to 52428800 bytes.
2020-01-21 14:41:00.926 nsplaydev[35018:10289250] PlayLiveSync: Applying filter expression - (platform == 'ios' || platform == 'all') && (msvi <= 41 || di == '0B0A73B8-412A-4785-82A9-C144682220B5')
2020-01-21 14:41:00.927 nsplaydev[35018:10289250] PlayLiveSync: PubNub listener started and subscribed to channel m-ch-1uhaBqFNw
2020-01-21 14:41:00.935 nsplaydev[35018:10289250] ***** Fatal JavaScript exception - application has been terminated. *****
2020-01-21 14:41:00.935 nsplaydev[35018:10289250] Native stack trace:
1   0x1010add50 NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
2   0x1010e5e8c NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
3   0x101c529b8 ffi_closure_SYSV_inner
4   0x101c541b4 .Ldo_closure
5   0x18b028ab8 <redacted>
6   0x18b029160 <redacted>
7   0x18af95a5c <redacted>
8   0x18af966f4 <redacted>
9   0x18af97a34 <redacted>
10  0x18af7aeb8 <redacted>
11  0x18bad33d0 <redacted>
12  0x18e0367dc <redacted>
13  0x18e03c958 <redacted>
14  0x18e047578 <redacted>
15  0x18df8ff1c <redacted>
16  0x18dfb9c08 <redacted>
17  0x18b654e58 <redacted>
18  0x187548834 <redacted>
19  0x187547fd4 <redacted>
20  0x187543250 <redacted>
21  0x187542adc CFRunLoopRunSpecific
22  0x1914c8328 GSEventRunModal
23  0x18b63dae0 UIApplicationMain
24  0x101c54044 ffi_call_SYSV
25  0x101c520dc ffi_call_int
26  0x101c51bd8 ffi_call
27  0x101070fe4 NativeScript::FunctionWrapper::call(JSC::ExecState*)
28  0x101c1eeb0 llint_entry
29  0x101c1c2c8 llint_entry
30  0x101c1c2c8 llint_entry
31  0x101c1c2c8 llint_entry
2020-01-21 14:41:00.939 nsplaydev[35018:10289250] JavaScript stack trace:
2020-01-21 14:41:00.939 nsplaydev[35018:10289250] SSE(file:///app/vendor.js:307:32)
at HelloWorldModel(file:///app/bundle.js:250:78)
at navigatingTo(file:///app/bundle.js:200:95)
at file:///app/tns_modules/@nativescript/core/data/observable/observable.js:110:23
at file:///app/tns_modules/@nativescript/core/ui/page/page-common.js:113:16
at file:///app/tns_modules/@nativescript/core/ui/page/page.js:73:27
at UIApplicationMain([native code])
at run(file:///app/tns_modules/@nativescript/core/application/application.js:312:22)
at file:///app/bundle.js:149:65
at ./app.ts(file:///app/bundle.js:165:34)
at __webpack_require__(file:///app/runtime.js:751:34)
at checkDeferredModules(file:///app/runtime.js:44:42)
at webpackJsonpCallback(file:///app/runtime.js:31:39)
at anonymous(file:///app/bundle.js:2:61)
at evaluate([native code])
at moduleEvaluation([native code])
at [native code]
at asyncFunctionResume([native code])
at [native code]
at promiseReactionJob([native code])
2020-01-21 14:41:00.939 nsplaydev[35018:10289250] JavaScript error:
file:///app/vendor.js:307:32: JS ERROR ReferenceError: Can't find variable: EventSource
2020-01-21 14:41:00.939 nsplaydev[35018:10289250] PlayLiveSync: Uncaught Exception
2020-01-21 14:41:00.940 nsplaydev[35018:10289250] PlayLiveSync: Sending crash report
2020-01-21 14:41:04.944 nsplaydev[35018:10289250] *** JavaScript call stack:
(
        0   UIApplicationMain@[native code]
        1   run@file:///app/tns_modules/@nativescript/core/application/application.js:312:22
        2   @file:///app/bundle.js:149:65
        3   ./app.ts@file:///app/bundle.js:165:34
        4   __webpack_require__@file:///app/runtime.js:751:34
        5   checkDeferredModules@file:///app/runtime.js:44:42
        6   webpackJsonpCallback@file:///app/runtime.js:31:39
        7   anonymous@file:///app/bundle.js:2:61
        8   evaluate@[native code]
        9   moduleEvaluation@:1:11
        10  @:2:1
        11  asyncFunctionResume@:1:11
        12  @:24:9
        13  promiseReactionJob@:1:11
)
2020-01-21 14:41:04.944 nsplaydev[35018:10289250] *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: ReferenceError: Can't find variable: EventSource

JS ERROR TypeError: null is not an object (evaluating 'err.description')

I'm playing with the demo and connect to a test node sse server:

const SSE = require("sse-node"),
    app = require("express")();

app.get("/", (req, res) => {
    const client = SSE(req, res);
    client.send("Hello world!");
    client.onClose(() => console.log("Bye client!"));
});
app.listen(8000);

If for any reason the connection is closed (stopping nodejs server) I get this error:
file:///app/tns_modules/nativescript-sse/sse.js:31:31: JS ERROR TypeError: null is not an object (evaluating 'err.description')

The plugin version is 2.0.0

Cannot read property 'extend' of undefined

Hi.

I've got error

System.err: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.nativescript.thirdcore/com.tns.NativeScriptActivity}: com.tns.NativeScriptException:
System.err: Calling js method onCreate failed
System.err: Error: Building UI from XML. @file:///app/app-root.xml:1:1
System.err:  > Cannot read property 'extend' of undefined
System.err: File: "file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/ui/builder/builder.js, line: 244, column: 20
System.err: StackTrace:
System.err:     Frame: function:'ScopeError', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/utils/debug.js', line: 63, column: 24
System.err:     Frame: function:'SourceError', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/utils/debug.js', line: 74, column: 23
System.err:     Frame: function:'', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 263, column: 17
System.err:     Frame: function:'', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 244, column: 33
System.err:     Frame: function:'', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/xml/xml.js', line: 148, column: 13
System.err:     Frame: function:'EasySAXParser.parse', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/js-libs/easysax/easysax.js', line: 751, column: 23
System.err:     Frame: function:'XmlParser.parse', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/xml/xml.js', line: 195, column: 22
System.err:     Frame: function:'XmlStringParser.parse', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 250, column: 27
System.err:     Frame: function:'parseInternal', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 212, column: 11
System.err:     Frame: function:'loadInternal', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 117, column: 27
System.err:     Frame: function:'loadPage', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 53, column: 27
System.err:     Frame: function:'', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 72, column: 12
System.err:     Frame: function:'', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 86, column: 20
System.err:     Frame: function:'ActivityCallbacksImplementation.setActivityContent', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 827, column: 50
System.err:     Frame: function:'ActivityCallbacksImplementation.onCreate', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 679, column: 14
System.err:     Frame: function:'NativeScriptActivity.onCreate', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/ui/frame/activity.js', line: 20, column: 25
System.err:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
System.err:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
System.err:     at android.app.ActivityThread.access$800(ActivityThread.java:135)
System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
System.err:     at android.os.Handler.dispatchMessage(Handler.java:102)
System.err:     at android.os.Looper.loop(Looper.java:136)
System.err:     at android.app.ActivityThread.main(ActivityThread.java:5017)
System.err:     at java.lang.reflect.Method.invokeNative(Native Method)
System.err:     at java.lang.reflect.Method.invoke(Method.java:515)
System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
System.err:     at dalvik.system.NativeStart.main(Native Method)
System.err: Caused by: com.tns.NativeScriptException:
System.err: Calling js method onCreate failed
System.err: Error: Building UI from XML. @file:///app/app-root.xml:1:1
System.err:  > Cannot read property 'extend' of undefined
System.err: File: "file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/ui/builder/builder.js, line: 244, column: 20
System.err: StackTrace:
System.err:     Frame: function:'ScopeError', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/utils/debug.js', line: 63, column: 24
System.err:     Frame: function:'SourceError', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/utils/debug.js', line: 74, column: 23
System.err:     Frame: function:'', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 263, column: 17
System.err:     Frame: function:'', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 244, column: 33
System.err:     Frame: function:'', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/xml/xml.js', line: 148, column: 13
System.err:     Frame: function:'EasySAXParser.parse', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/js-libs/easysax/easysax.js', line: 751, column: 23
System.err:     Frame: function:'XmlParser.parse', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/xml/xml.js', line: 195, column: 22
System.err:     Frame: function:'XmlStringParser.parse', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 250, column: 27
System.err:     Frame: function:'parseInternal', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 212, column: 11
System.err:     Frame: function:'loadInternal', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 117, column: 27
System.err:     Frame: function:'loadPage', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 53, column: 27
System.err:     Frame: function:'', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 72, column: 12
System.err:     Frame: function:'', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 86, column: 20
System.err:     Frame: function:'ActivityCallbacksImplementation.setActivityContent', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 827, column: 50
System.err:     Frame: function:'ActivityCallbacksImplementation.onCreate', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 679, column: 14
System.err:     Frame: function:'NativeScriptActivity.onCreate', file:'file:///data/data/org.nativescript.thirdcore/files/app/tns_modules/tns-core-modules/ui/frame/activity.js', line: 20, column: 25
System.err:     at com.tns.Runtime.callJSMethodNative(Native Method)
System.err:     at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1101)
System.err:     at com.tns.Runtime.callJSMethodImpl(Runtime.java:983)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:970)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:954)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:946)
System.err:     at com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:18)
System.err:     at android.app.Activity.performCreate(Activity.java:5231)
System.err:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
System.err:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
System.err:     ... 11 more

when trying to use plugin. My code:

const SSE = require('nativescript-sse').SSE;
let sse = new SSE('http://0.0.0.0:5000/stream', {});

sse.events.on('onConnect', (data) => {
    console.log('onConnect: ' + data);
});
sse.events.on('onMessage', (data) => {
    console.log('onMessage: ' + data);
});
sse.events.on('onError', (data) => {
    console.log('onError: ' + data);
});

After some debugging I've managed to determine
screenshot

Run in Android emulator (from Android Studio) with

  • CLI: 4.2.0-2018-07-12-11970
  • Cross-platform modules: 4.2.0-2018-07-18-03
  • Runtime(s): "tns-android": { "version": "4.2.0-2018-07-18-02" }
  • package.json plugin(s): "dependencies": { "nativescript-sse": "^3.0.3", "nativescript-theme-core": "~1.0.4", "tns-core-modules": "4.2.0-2018-07-18-03" }, "devDependencies": { "nativescript-dev-webpack": "~0.14.0", "tns-platform-declarations": "^4.1.0" }

How can this problem be fixed?

Java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

Make sure to check the demo app(s) for sample usage

Make sure to check the existing issues in this repository

If the demo apps cannot help and there is no issue for your problem, tell us about it

Please, ensure your title is less than 63 characters long and starts with a capital
letter.

Trying to connect to some endpoints with SSL results in this error:

java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

Apparently this error can happen when SSL certs are configured incorrectly, but I am very confident mine are correct, and it does the same thing with google.com which I think we can assume is correct.

Which platform(s) does your issue occur on?

  • iOS/Android/Both Android
  • iOS/Android versions 11
  • emulator or device. What type of device? Both

Please, provide the following version numbers that your issue occurs with:

  • CLI: (run tns --version to fetch it) 8.0.1
  • Cross-platform modules: (check the 'version' attribute in the
    node_modules/tns-core-modules/package.json file in your project) 6.5.27
  • Runtime(s): (look for the "tns-android" and "tns-ios" properties in the package.json file of your project) "@nativescript/android": "8.0.0"
  • Plugin(s): (look for the version numbers in the package.json file of your
    project and paste your dependencies and devDependencies here)

default dependencies from a new project with ns create

Please, tell us how to recreate the issue in as much detail as possible.

Describe the steps to reproduce it.

Try to connect to an SSE endpoint with SSL/https. Some endpoints work fine and some don't. I can't find a correlation between any certificate configuration or TLS version/cipher. Google.com causes the error, Yahoo.com works as expected (Not event stream error)
.

Is there any code involved?

  • provide a code example to recreate the problem
  • (EVEN BETTER) provide a .zip with application or refer to a repository with application where the problem is reproducible.
// this throws the error
let sse = new SSE('https://google.com');

Here is a sample project that shows the problem:

ns-sse-sample2.zip

  • unzip
  • npm install
  • change the "events" property from "protected" to "public" in node_modules/nativescript-sse/sse.common.d.ts to avoid compiler errors
  • ns run android

Angular support

Hi,

I have more of a question - does this work with Angular, as I am having trouble using it but what I get is
either Angular saying there is no such module, and if I try to import from 'nativescript-sse/sse.android' for example I get this after running the app:

Error: com.tns.NativeScriptException: Failed to find module: "nativescript-sse/sse.android", relative to: app/tns_modules/

Property 'events' is protected and only accessible within class 'BaseSSE' and its subclasses.

When I try to access 'events' property this error occurs:

Property 'events' is protected and only accessible within class 'BaseSSE' and its subclasses.

Then when I go into node modules and change 'events' into a non protected property there are always these errors:

java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

SSL handshake aborted: ssl=0xf0657948: Failure in SSL library, usually a protocol error.

routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED

Can anyone help? Thank you

Demo not working with NativeScript 3.4.3 (and 4.x.x)

When trying the run the demo project with official NativeScript (currently 3.4.3) or with next versions, the demo fails runtime on Android and on iOS with

Cycle link found.
Cycle link found.
Cycle link found.
Cycle link found.
Cycle link found.
Cycle link found.
Cycle link found.
Cycle link found.
Cycle link found.
Cycle link found.
Cycle link found.
Unable to apply changes on device: 00d3e1311075c66f. Error is: Processing node_modules failed. Error: cp: cannot create directory '/Users/niliev/Desktop/repositories/nativescript-sse/demo/platforms/android/app/src/main/assets/app/tns_modules': No such file or directory.
Executing after-watch hook from /Users/niliev/Desktop/repositories/nativescript-sse/demo/hooks/after-watch/nativescript-dev-typescript.js

Steps to reproduce:

git clone https://github.com/triniwiz/nativescript-sse
npm i 
tsc
cd demo
tns run ios | android

While using the following package.json for the demo project:

{
  "nativescript": {
    "id": "org.nativescript.demo",
    "tns-android": {
      "version": "3.4.2"
    },
    "tns-ios": {
      "version": "3.4.1"
    }
  },
  "dependencies": {
    "nativescript-sse": "file:..",
    "tns-core-modules": "^3.4.1"
  },
  "devDependencies": {
    "babel-traverse": "6.7.6",
    "babel-types": "6.7.7",
    "babylon": "6.7.0",
    "filewalker": "0.1.2",
    "lazy": "1.0.11",
    "nativescript-dev-typescript": "^0.6.0",
    "tns-platform-declarations": "^3.4.1",
    "typescript": "~2.4.2"
  }
}

Same happens with the upcoming next versions

{
  "nativescript": {
    "id": "org.nativescript.demo",
    "tns-android": {
      "version": "4.0.0-rc-2018.4.2.1"
    },
    "tns-ios": {
      "version": "4.0.1-rc-2018-04-05-01"
    }
  },
  "dependencies": {
    "nativescript-sse": "file:..",
    "tns-core-modules": "^4.0.0-2018-04-10-01"
  },
  "devDependencies": {
    "babel-traverse": "6.7.6",
    "babel-types": "6.7.7",
    "babylon": "6.7.0",
    "filewalker": "0.1.2",
    "lazy": "1.0.11",
    "nativescript-dev-typescript": "^0.6.0",
    "tns-platform-declarations": "^3.4.1",
    "typescript": "~2.4.2"
  }
}

npm install !== git clone

Hi,

The source installed when doing
npm install nativescript-sse and
git clone https://github.com/triniwiz/nativescript-sse.git
are different. The npm version is pure Javascript and the git clone version is Typescript.

Also trying to use either doesn't work. Creating a new issue for that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.