Notalib / nativescript-webview-ext

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

Could not load view for: nativewebviewext #101

Closed donmb1 closed 3 years ago

donmb1 commented 3 years ago

Make sure to check the demo app(s) for sample usage

Checked

Make sure to check the existing issues in this repository

Checked This is what I found but it didn't solve the problem for me: https://github.com/Notalib/nativescript-webview-ext/issues/96

If the demo apps cannot help and there is no issue for your problem, tell us about it

I get this error when running tns preview

2021-02-03 11:44:25.586 nsplaydev[16102:6711270] JavaScript error:
file:///app/tns_modules/nativescript-vue/dist/index.js:9186:80: JS ERROR TypeError: Could not load view for: nativewebviewext. TypeError: undefined is not a constructor (evaluating 'new _nativescript_core__WEBPACK_IMPORTED_MODULE_0__["Property"]')
2021-02-03 11:44:25.587 nsplaydev[16102:6711270] PlayLiveSync: Uncaught Exception
2021-02-03 11:44:25.587 nsplaydev[16102:6711270] *** JavaScript call stack:
(
    0   UIApplicationMain@[native code]
    1   run@file:///app/tns_modules/@nativescript/core/application/application.js:312:26
    2   @file:///app/tns_modules/nativescript-vue/dist/index.js:14069:18
    3   @file:///app/vendor.js:8021:25
    4   @file:///app/bundle.js:313:10
    5   ./main.js@file:///app/bundle.js:317:34
    6   __webpack_require__@file:///app/runtime.js:817:34
    7   checkDeferredModules@file:///app/runtime.js:44:42
    8   webpackJsonpCallback@file:///app/runtime.js:31:39
    9   anonymous@file:///app/bundle.js:2:61
    10  evaluate@[native code]
    11  moduleEvaluation@:1:11
    12  @:2:1
    13  asyncFunctionResume@:1:11
    14  @:24:9
    15  promiseReactionJob@:1:11
)
2021-02-03 11:44:25.587 nsplaydev[16102:6711270] *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: TypeError: Could not load view for: nativewebviewext. TypeError: undefined is not a constructor (evaluating 'new _nativescript_core__WEBPACK_IMPORTED_MODULE_0__["Property"]')
 at 
getViewClass(file:///app/tns_modules/nativescript-vue/dist/index.js:9186:80)

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

My main.js

Vue.registerElement("WebViewExt", () => require("@nota/nativescript-webview-ext").WebViewExt)

My App.vue

<WebViewExt
    src="......"
/>

Is there any code involved?

See above, this is all code involved

donmb1 commented 3 years ago

Just a quick follow up if anyone can help me here? Thank you

m-abs commented 3 years ago

As far as I understand it, you can't use custom plugins with tns preview, I'm guessing that's why it isn't working for you.

donmb1 commented 3 years ago

Ahh that would make sense. Thanks for clarification.