Problem with Nativescript 7 angular 8 and nativescript-google-maps-sdk - nativescript

I'm facing this error when trying to dislay google maps on android emulator, using nativescript 7.2.0 Angular 8 and nativescript-google-maps-sdk 3.0.2 :
JS: ERROR Error: Uncaught (in promise): TypeError: nativescript_core__WEBPACK_IMPORTED_MODULE_1_.Property is not a constructor
JS: TypeError: nativescript_core__WEBPACK_IMPORTED_MODULE_1_.Property is not a constructor
JS: at Module.../node_modules/nativescript-google-maps-sdk/map-view-common.js (file: node_modules\nativescript-google-maps-sdk\map-view-common.js:275:7)
JS: at webpack_require (file: src\webpack\bootstrap:750:0)
JS: at fn (file: src\webpack\bootstrap:120:0)
JS: at Module.../node_modules/nativescript-google-maps-sdk/map-view.js (file: node_modules\nativescript-google-maps-sdk\map-view.android.js:1:0)
JS: at webpack_require (file: src\webpack\bootstrap:750:0)
JS: at fn (file: src\webpack\bootstrap:120:0)
JS: at Module../app/home/home.component.ts (file: src\app\home\home.component.ts:1:0)
JS: at webpack_require (f...
If anyone can help
Thank you

You may want to check out the issues on the nativescript-google-maps-sdk github site, particularly this one.

Related

How to use Adminlte3 built Toastr plugin into a Vue app

i'm trying to use this lib from AdminLTE in a Vue project. I would like to know if it's possible.
AdminLTE Doc
Screen Cap
I've installed adminlte by npm, and already have jquery too
I have a app.js file with my Vue const App, and my components.
This is my code in my App.js file
import 'admin-lte/plugins/toastr/toastr.min.js'
import 'admin-lte/plugins/toastr/toastr.min.css'
$(document).Toasts('create', {
icon: 'fas fa-exclamation-triangle',
class: 'bg-danger m-1',
autohide: true,
delay: 5000,
title: 'An error has occured',
body: 'Something went wrong'
})
But I get this error message in console
app.js:6776 Uncaught TypeError: $(...).Toasts is not a function
at Module../resources/js/app.js (app.js:6776:13)
at __webpack_require__ (app.js:221424:42)
at app.js:221593:64
at Function.__webpack_require__.O (app.js:221468:24)
at app.js:221595:53
at app.js:221597:12
Honestly I don't have idea how to start, I hope you can help me, thanks

Nativescript and SignalR?

I’m developing an app using NativeScript + Angular and need it to have a SignalR connection. I'm using nativescript-signalr-core plugin to connect my app with the signalR. The server side project is written by asp.net core 3.1 (this link).
According to the instructions of plugin, I want to connect to the server, it connects the first moment but it is disconnected immediately.
This is my typescript code:
connectToServer_Core() {
this.signalrCore.start(this.hubUrl).then((isConnected: boolean) => {
console.log('isConnected? ', isConnected);
console.log('status: ' + JSON.stringify(this.signalrCore.getStatus()));
})
.catch(error => {
console.error(error.message);
});
}
This is the output of the function execution:
JS: isConnected? true
JS: status: {"id":2,"name":"Socket Opened"}
JS: disconnected
JS: Unhandled Promise rejection: Error - Connection already close! ; Zone: <root> ;
Task: setTimeout ; Value: Error - Connection already close! undefined
This is the output after invoke():
JS: status: {"id":2,"name":"Socket Opened"}
JS: ERROR Error: Uncaught (in promise): Error - socket is not connected
Please help me how to solve this problem?

D3.js v5 loading behavior is different from v3 in Jupyter Notebook

I wish to use d3 and Jupyter together. I can load and use v3 of d3 but v5 appears to load successfully but is not then accessible.
%%html
Hello
<SVG HEIGHT=100 WIDTH=100></SVG>
%%javascript
if (typeof(d3) !== "undefined") { d3=undefined; }
setTimeout(() => {
$.getScript("https://d3js.org/d3.v5.min.js")
.done(function (script, textStatus) {
console.log(textStatus);
d3.selectAll("SVG").
append("circle").
attr("r",10).attr("cx",10).attr("cy",10).attr("fill","red")});
}, 1000);
When executed Chrome shows the following error in the Javascript console
VM632:6 Uncaught TypeError: Cannot read property 'selectAll' of undefined
at Object.eval (eval at append_javascript (outputarea.js:762), <anonymous>:6:16)
at u (jquery.min.js:2)
at Object.fireWith [as resolveWith] (jquery.min.js:2)
at k (jquery.min.js:2)
at HTMLScriptElement.n (jquery.min.js:2)
at HTMLScriptElement.dispatch (jquery.min.js:2)
at HTMLScriptElement.y.handle (jquery.min.js:2)
The equivalent code bundled in an HTML file loads and works. Changing the d3 url to load v3 instead of v5 also works.
I've tried this on 2 different Windows 10 machines primarily on Chrome but with equivalent behavior on IE. FWIW I have tried clearing the browser caches.
I'm using Jupyter 5.7.4 with Python 3.7.1.
Is this broken or am I doing something wrong?

How to get error message in NativeScript 5?

Could help me. How to get Error message in NativeScript 5 ?
try {
devices = getDeviceList();
} catch (error) {
console.log(error.message);
}
This code write to console
'org.nativescript.b360124.serailport.NSSerialport$NSSerialPortException:
Device not found! JS:
org.nativescript.b360124.serailport.NSSerialport.getDeviceList(NSSerialport.java:66)
JS: com.tns.Runtime.callJSMethodNative(Native Method) JS:
com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1120) JS:
com.tns.Runtime.callJSMethodImpl(Runtime.java:1000) JS:
com.tns.Runtime.callJSMethod(Runtime.java:987) JS:
com.tns.Runtime.callJSMethod(Runtime.java:967) JS:
com.tns.Runtime.callJSMethod(Runtime.java:959)
And how get message "Device not found!", Thanks.

Echo is not defined Laravel 5.4

I am trying to set up event broadcasting with Laravel 5.4 + Redis + Sockets + Echo but I'm running into a problem. I've run:
npm install --save laravel-echo
I've put the following at the bottom of my resources/assets/js/bootstrap.js file:
import Echo from "laravel-echo"
window.Echo = new Echo({
broadcaster: 'socket.io',
host: window.location.hostname + ':6001'
});
I've then run the following to compile everything:
npm run dev
I am including the compiled app.js file in the head and trying to listen like so :
<!DOCTYPE html>
<html lang=en>
<head>
<meta name="csrf-token" content="epkZXByjsW4lU6wwD2mELWe60Q26m3642lvMCoLK">
<script src="http://localhost:3000/js/app.js"></script>
</head>
<body>
<h1>Chat</h1>
<script src="//localhost:6001/socket.io/socket.io.js"></script>
<script type="text/javascript">
Echo.private('chat')
.listen('MessageSentEvent', (e) => {
console.log(e.update);
});
</script>
</body>
</html>
In the console I get the following two errors:
Uncaught TypeError: Cannot read property 'csrfToken' of undefined
at Object.<anonymous> (bootstrap.js:24)
at __webpack_require__ (bootstrap 2b5c37a…:19)
at Object.<anonymous> (app.js:8)
at __webpack_require__ (bootstrap 2b5c37a…:19)
at Object.<anonymous> (module.js:22)
at __webpack_require__ (bootstrap 2b5c37a…:19)
at bootstrap 2b5c37a…:65
at bootstrap 2b5c37a…:65
(anonymous) # bootstrap.js:24
__webpack_require__ # bootstrap 2b5c37a…:19
(anonymous) # app.js:8
__webpack_require__ # bootstrap 2b5c37a…:19
(anonymous) # module.js:22
__webpack_require__ # bootstrap 2b5c37a…:19
(anonymous) # bootstrap 2b5c37a…:65
(anonymous) # bootstrap 2b5c37a…:65
chat:36 Uncaught ReferenceError: Echo is not defined
at chat:36
What am I doing wrong?
I think it's because you defined window.Echo, not Echo.
To access it, do this instead:
window.Echo.channel()....
At chat line 36 change this:
Echo.private('chat')
.listen('MessageSentEvent', (e) => {
console.log(e.update);
});
To this:
window.Echo.private('chat')
.listen('MessageSentEvent', (e) => {
console.log(e.update);
});
Hope this fixes your problem!
You didn't mention that upon which event you are getting that error on console.
These may help:
https://github.com/tlaverdure/laravel-echo-server/issues/68
https://github.com/laravel/echo/issues/65
It looks like you are trying to create a chat application. I recently built such chat app using Laravel 5.4 + Redis + Sockets + Echo:
https://github.com/xparthx/laravel-realtime-chat
It will help you to build your own once you check that.
Thanks

Resources