nativescript-webview-interface
nativescript-webview-interface copied to clipboard
"Uncaught TypeError: Cannot read property '_onNativeEvent' of undefined"
i get this in console @shripalsoni04
chromium: [INFO:CONSOLE(1)] "Uncaught TypeError: Cannot read property '_onNativeEvent' of undefined", source: (1)
heres my system info
$ tns info All NativeScript components versions information ┌──────────────────┬─────────────────┬────────────────┬─────────────┐ │ Component │ Current version │ Latest version │ Information │ │ nativescript │ 3.4.1 │ 3.4.1 │ Up to date │ │ tns-core-modules │ 3.4.0 │ 3.4.0 │ Up to date │ │ tns-android │ 3.4.1 │ 3.4.1 │ Up to date │ │ tns-ios │ 3.4.1 │ 3.4.1 │ Up to date │ └──────────────────┴─────────────────┴────────────────┴─────────────┘
am using vanilla Javascript
I'm having the same problem.
i am having the same issue ...
I solved it by cloning the demo and including the folder ‘www’ from the demo into my App, then modify the ‘www/index.js’ to my liking(am using leafletjs for my Map, so I get events from the map and to the map from {N}) hope it helps
From: Idrees Khan [mailto:[email protected]] Sent: March 21, 2018 09:01 AM To: shripalsoni04/nativescript-webview-interface [email protected] Cc: devyaz [email protected]; Author [email protected] Subject: Re: [shripalsoni04/nativescript-webview-interface] "Uncaught TypeError: Cannot read property '_onNativeEvent' of undefined" (#26)
i am having the same issue ...
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/shripalsoni04/nativescript-webview-interface/issues/26#issuecomment-374848256 , or mute the thread https://github.com/notifications/unsubscribe-auth/ATfQSZ2th8aAYiw9qWy6cVwPBCrzLIDMks5tgfq6gaJpZM4Rsla0 . https://github.com/notifications/beacon/ATfQSWm1_3pTaeaIR1aCGa4EnbF27MtIks5tgfq6gaJpZM4Rsla0.gif
Hello. I have the same issue on iOS device. It fails because the javascript local file cannot be loaded. I have followed the solution in this comment and it works. https://github.com/NativeScript/NativeScript/issues/6377#issuecomment-433322681
Nothing Work for me this error comes once in a while
hi, you need nativescript-webview-interface in your www folder or just clone it and use the www folder in your app or clone my repo Nativescript-Leaflet-Map as a working example you need a Mapbox Mapbox signup access token insert it into the index.html file
@devyaz , does the HTML file needs to be available locally?
yes it has, i didn't test hosted file, but i believe it should work
On Tue, 2 Mar 2021 04:44 Eric Locop, [email protected] wrote:
@devyaz https://github.com/devyaz , does the HTML file needs to be available locally?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/shripalsoni04/nativescript-webview-interface/issues/26#issuecomment-788533503, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE35ASLOVMBGZTMWOLMAMGDTBRGJ5ANCNFSM4ENSK22A .
@devyaz , BTW, the plugin does not work on iOS (no logs in the console at all) and on Android, passing data from webview to nativeapp works but not when passing data from nativeapp to webview and showing this error.
Uncaught TypeError: Cannot read property '_onNativeEvent' of undefined
Note: I'm trying to load a hosted page and not a local file.
Someone got news from that ?
@ejlocop did you find the solution???
I did back then, but thanks to webpack it doesn't work any more, I've switched to Flutter now trying flutter_webview_plus but I can't get leaflet map to render with local assets, only hosted
I solved it by cloning the demo and including the folder ‘www’ from the demo into my App, then modify the ‘www/index.js’ to my liking(am using leafletjs for my Map, so I get events from the map and to the map from {N}) hope it helps
From: Idrees Khan [mailto:[email protected]] Sent: March 21, 2018 09:01 AM To: shripalsoni04/nativescript-webview-interface [email protected] Cc: devyaz [email protected]; Author [email protected] Subject: Re: [shripalsoni04/nativescript-webview-interface] "Uncaught TypeError: Cannot read property '_onNativeEvent' of undefined" (#26)
i am having the same issue ...
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/shripalsoni04/nativescript-webview-interface/issues/26#issuecomment-374848256 , or mute the thread https://github.com/notifications/unsubscribe-auth/ATfQSZ2th8aAYiw9qWy6cVwPBCrzLIDMks5tgfq6gaJpZM4Rsla0 . https://github.com/notifications/beacon/ATfQSWm1_3pTaeaIR1aCGa4EnbF27MtIks5tgfq6gaJpZM4Rsla0.gif
This was the way I solved it out
It's a race condition problem. I solve it using a 300ms delay like this:
setTimeout(function () {
oWebViewInterface.emit("from-native", { data: "testing" });
}, 300);
I'm using the latest {N} and android 12.