-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebView element error undefined is not an object (evaluating 'this.oLangWebViewInterface.callJSFunction' #49
Comments
i try to change the code to this <WebView row="0" (loaded)="onWebViewLoaded($event)" height="1px" width="1px"> import { WebViewInterface } from 'nativescript-webview-interface'; and know i only have problem with the WebView message - Error loading ~/www/index.html : The requested URL was not found on this server. |
@BJacob7 have you found the issue? |
I'm also getting this error. I'll post an update if I can find a way around it. |
@Eonfuzz this is my solution
|
Thanks @ninjaonsafari. Do you ever try to invoke a js webview function? I still run into undefined is not an object (evaluating 'this.oLangWebViewInterface.callJSFunction') while following your setup |
So it turns out Update webpack.config.js to directly include the html file like so:
(See this issue for more details NativeScript/nativescript-dev-webpack#718) But now I've gone and run into a seperate issue where executeJS isn't actually executing the JS inside the webview on iOS. |
hi , since i upgrade my env to nativescript 6.0.0 im having trouble to run webview
im getting and error on callJSFunction
undefined is not an object (evaluating 'this.oLangWebViewInterface.callJSFunction')
import { WebView, LoadEventData } from 'tns-core-modules/ui/web-view/'; create : let webViewInterfaceModule = require('nativescript-webview-interface');
hild: @ViewChild('installationWebView', {static: false}) webView: ElementRef;
object: private oLangWebViewInterface;
ngAfterViewInit() {
}
function private setupWebViewInterface() {
let webView: WebView = this.webView.nativeElement;
this.oLangWebViewInterface = new webViewInterfaceModule.WebViewInterface(webView, '~/www/index.html');
}
connect to device function :
private connectToDevice() {
//this.isConnecting = true;
this.oLangWebViewInterface.callJSFunction('connectToDevice', null, (response: any) => {
console.log(JSON.stringify(response));
}
The text was updated successfully, but these errors were encountered: