i tryed to import the Nota NativeScript Webview Ext in my nativescript vue.js application (see https://market.nativescript.org/plugins/@nota%2Fnativescript-webview-ext)
i added the npm package in the playground web application without any errors or problems.
the following code is used in my app.js file:
import vue.js from ‘nativescript-vue’;
import App from ‘./components/App’;
import ‘@nota/nativescript-webview-ext/vue’;
Vue.config.silent = false;
new Vue({
render: h => h(‘frame’, [h(App)])
}).$start();
but unfortunately i got the following error
2019-06-11 15:55:30.942 nsplaydev[15435:3295521] PlayLiveSync: Uncaught Exception
2019-06-11 15:55:30.942 nsplaydev[15435:3295521] *** JavaScript call stack:
(
)
2019-06-11 15:55:30.942 nsplaydev[15435:3295521] *** Terminating app due to uncaught exception ‘NativeScript encountered a fatal error: Error: Could not find module ‘@nota/nativescript-webview-ext/vue’. Computed path ‘/var/mobile/Containers/Data/Application/F4AE564B-FAFA-4128-BC98-F087145C5FF1/Documents/Playground/LiveSync/app/tns_modules/@nota/nativescript-webview-ext/vue’.
at
1 require@file:///app/app.js:11:8
2 anonymous@file:///app/app.js:11:8
3 evaluate@[native code]
4 moduleEvaluation@[native code]
5 promiseReactionJob@[native code]
‘, reason: ‘(null)’
*** First throw call stack:
(0x1ba9623a8 0x1b9b67d00 0x10499f7f4 0x1049dda00 0x1059433c8 0x10429b3f0 0x1ba3a8fd8)
libc++abi.dylib: terminating with uncaught exception of type NSException
2019-06-11 15:55:30.942 nsplaydev[15435:3295521] PlayLiveSync: Uncaught Exception
Solution :
Not all the plugins are supported in Playground, only plugins without native dependencies are supported.
nativescript-webview-ext has native dependency for both iOS & Android, so it might not work as intended on Playground / Preview app.
FYI: Even if you use a plugin without native dependency, while running with Playground / Preview app, you should use relative path for importing anything from plugin.