Notalib / nativescript-webview-ext

Nativescript plugin with extended WebView functionality
Apache License 2.0
76 stars 37 forks source link

TypeError: Cannot read property 'rootViewController' of undefined #116

Closed tskweres closed 3 years ago

tskweres commented 3 years ago

Getting this error when trying to access the loadFinished event:

template:

<WebViewExt width="300"
    height="300"
    [src]="webviewURL"
    #webview
    (loadFinished)="loadFinished($event)">
  </WebViewExt>

component:

public loadFinished(e) {
    console.log('load finished ========= ')
}

package.json:

{
  "name": "Test",
  "main": "./src/main.ts",
  "displayName": "Test",
  "templateType": "App template",
  "version": "7.0.8",
  "description": "Test",
  "author": "hello@test.io",
  "license": "SEE LICENSE IN <your-license-filename>",
  "publishConfig": {
    "access": "public"
  },
  "keywords": [
  ],
  "repository": "<fill-your-repository-here>",
  "homepage": "https://github.com/NativeScript/nativescript-app-templates",
  "bugs": {
    "url": "https://github.com/NativeScript/NativeScript/issues"
  },
  "dependencies": {
    "@angular/animations": "~11.2.7",
    "@angular/cdk": "^11.2.8",
    "@angular/common": "~11.2.7",
    "@angular/compiler": "~11.2.7",
    "@angular/core": "~11.2.7",
    "@angular/forms": "~11.2.7",
    "@angular/localize": "~11.0.0",
    "@angular/platform-browser": "~11.2.7",
    "@angular/platform-browser-dynamic": "~11.2.7",
    "@angular/router": "~11.2.7",
    "@nativescript/angular": "~11.8.0",
    "@nativescript/core": "^8.0.0",
    "@nativescript/secure-storage": "^3.0.0",
    "@nativescript/theme": "~3.0.0",
    "@ng-bootstrap/ng-bootstrap": "^9.1.0",
    "@nota/nativescript-webview-ext": "^8.0.0",
    "@nstudio/nativescript-checkbox": "^2.0.4",
    "@nstudio/nativescript-loading-indicator": "^4.0.0",
    "@nstudio/nativescript-pulltorefresh": "^3.0.1",
    "@schematics/angular": "^9.1.0",
    "@triniwiz/nativescript-image-cache-it": "^7.0.5",
    "@triniwiz/nativescript-pager": "^13.0.1",
    "@types/mocha": "^8.2.2",
    "bootstrap": "^4.5.0",
    "email-validator": "^2.0.4",
    "ethers": "^5.1.4",
    "etherspot": "^1.2.4",
    "libphonenumber-js": "^1.9.13",
    "moment": "^2.29.1",
    "nativescript-contacts-lite": "^0.2.7",
    "nativescript-lottie": "^5.0.3",
    "nativescript-materialdropdownlist": "^1.0.15",
    "nativescript-statusbar": "^5.0.0",
    "nativescript-taptic-engine": "^2.1.0",
    "nativescript-ui-chart": "^8.0.2",
    "nativescript-ui-listview": "^9.1.0",
    "nativescript-websockets": "^1.5.6",
    "numeral": "^2.0.6",
    "reflect-metadata": "^0.1.13",
    "rxjs": "^6.6.7",
    "util": "^0.12.3",
    "zone.js": "~0.11.1"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~11.2.7",
    "@nativescript/ios": "8.0.0",
    "@nativescript/schematics": "^11.0.0",
    "@nativescript/webpack": "~5.0.0-beta.0",
    "@ngtools/webpack": "~11.2.6",
    "node-sass": "^5.0.0",
    "prettier": "^2.2.1",
    "tslint": "^6.1.3",
    "typescript": "~4.0.0"
  },
  "private": "true",
  "readme": "NativeScript Application"
}
tskweres commented 3 years ago

Seems to be working now, but ns-bridge-ready never fires and gives me the bridge