Notalib / nativescript-webview-ext

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

Errors when migrating to Angular 10 and N 7.0 #88

Closed madmas closed 3 years ago

madmas commented 4 years ago

HI, I want wo upgrade my app that makes use of this plugin to Angular 10 and follow the blogpost https://nativescript.org/blog/upgrading-tips-for-angular-10/.

Now I get this error message on startup:

ERROR in ../node_modules/@nota/nativescript-webview-ext/angular/index.js
Module not found: Error: Can't resolve '@nativescript/angular/element-registry' in '/app/node_modules/@nota/nativescript-webview-ext/angular'
 @ ../node_modules/@nota/nativescript-webview-ext/angular/index.js 4:25-74
 @ ./app/app.module.ts
 @ ./main.ts

ERROR in ../node_modules/@nota/nativescript-webview-ext/webview-ext-common.js
Module not found: Error: Can't resolve 'tns-core-modules/ui/core/view/view' in '/app/node_modules/@nota/nativescript-webview-ext'
 @ ../node_modules/@nota/nativescript-webview-ext/webview-ext-common.js 8:13-58
 @ ../node_modules/@nota/nativescript-webview-ext/webview-ext.js
 @ ../node_modules/@nota/nativescript-webview-ext/angular/index.js
 @ ./app/app.module.ts

From my point of view, for the first error, the import needs to be changed to import { isKnownView, registerElement } from @nativescript/angular.

The the second error, it need to be migrated to @nativescript/core and the import need to be fixed.

Environment

m-abs commented 4 years ago

We're currently not working on our nativescript app using this plugin.

So I can't promise when we'll have an upgrade available, we'd happily accept a PR for it.

m-abs commented 3 years ago

Could you try v7.0.0?

madmas commented 3 years ago

@m-abs thanks a lot for the upgrade! I was also working on it but couldn't finish it before my vacations. Will check it out during the next days.

phoenix503 commented 3 years ago

Hi @madmas , I am facing the same issue in v7.0.0.Did you manage to solve it Issue :

ERROR Error: Uncaught (in promise): TypeError: Could not load view for: WebViewExt.TypeError: undefined is not a constructor (evaluating 'new _nativescript_core__WEBPACK_IMPORTED_MODULE_0__["Property"]')
getViewClass(file: node_modules/@nativescript/angular/element-registry.js:84:0)
at file: node_modules/@nativescript/angular/view-util.js:214:0
m-abs commented 3 years ago

@phoenix503 Could you share your package.json?

madmas commented 3 years ago

Hi @m-abs and @phoenix503 yes, I have successfully tested it with our migrated app, thanks a lot @m-abs !

JungMinHur commented 3 years ago

I am facing the same issue

TypeError: Could not load view for: nativewebviewext. TypeError: undefined is not a constructor (evaluating 'new _nativescript_core__WEBPACK_IMPORTED_MODULE_0__["Property"]') ../node_modules/@nota/nativescript-webview-ext/webview-ext-common.js(file:///app/vendor.js:54613:97) at __webpack_require__(file:///app/runtime.js:751:34) at fn(file:///app/runtime.js:121:39) at ../node_modules/@nota/nativescript-webview-ext/webview-ext.js(file:///app/vendor.js:55715:96) at __webpack_require__(file:///app/runtime.js:751:34) at fn(file:///app/runtime.js:121:39) at file:///app/vendor.js:54573:118 at getViewClass(file:///app/vendor.js:118743:26) at ElementNode(file:///app/vendor.js:119590:33) at createElement(file:///app/vendor.js:119696:29) at createElm(file:///app/vendor.js:116371:92) at createChildren(file:///app/vendor.js:116491:18) at createElm(file:///app/vendor.js:116376:23) at patch(file:///app/vendor.js:116962:16) at file:///app/vendor.js:115947:28 at updateComponent(file:///app/vendor.js:116076:17) at get(file:///app/vendor.js:113519:29) at Watcher(file:///app/vendor.js:113506:48) at mountComponent(file:///app/vendor.js:116083:14) at init(file:///app/vendor.js:115142:19) at createComponent(file:///app/vendor.js:116404:10) at createElm(file:///app/vendor.js:116352:24) at patch(file:///app/vendor.js:116962:16) at file:///app/vendor.js:115947:28 at updateComponent(file:///app/vendor.js:116076:17) at get(file:///app/vendor.js:113519:29) at Watcher(file:///app/vendor.js:113506:48) at mountComponent(file:///app/vendor.js:116083:14) at init(file:///app/vendor.js:115142:19) at createComponent(file:///app/vendor.js:116404:10) at createElm(file:///app/vendor.js:116352:24) at patch(file:///app/vendor.js:116962:16) at file:///app/vendor.js:115947:28 at updateComponent(file:///app/vendor.js:116076:17) at get(file:///app/vendor.js:113519:29) at Watcher(file:///app/vendor.js:113506:48) at mountComponent(file:///app/vendor.js:116083:14) at file:///app/vendor.js:123780:43 at initializePromise([native code]) at Promise([native code]) at file:///app/vendor.js:123765:25 at file:///app/bundle.js:5721:29 at promiseReactionJob([native code]) at UIApplicationMain([native code]) at run(file:///app/vendor.js:869:22) at file:///app/vendor.js:123592:18 at file:///app/bundle.js:23238:10 at ./main.js(file:///app/bundle.js:23242: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])

lukesUbuntu commented 3 years ago

@JungMinHur did you end up resolving your issue?

m-abs commented 3 years ago

Closed due to inactivity.