POV
POV

Reputation: 12015

How to buld npm dependencies in NativeScript in preview mode?

I use NativeScript and npm dependencies in package.json. When I launch application using command: tns preview it gives me ready application with error:

Plugin @ngx-translate/core is not included in preview app on device

My package.json is:

{
"dependencies": {
 "@ngx-translate/core": "^11.0.1",
    "@ngx-translate/http-loader": "^4.0.0"
}
}

I guess NativeScript does not build npm dependencies in this mode, or these dependencies are not compatible.

Upvotes: 0

Views: 85

Answers (1)

Hélder F.
Hélder F.

Reputation: 58

Nativescript Preview feature is limited to the already compiled modules. With this said, you cannot use Preview if you are including external dependencies and therefore you need to go with the tns run command.

Please see the following SO question as this might be a duplicate: Error: 'tns preview' - Plugin not include

Edit: please check for @Manoj reply to this comment as I was very generic and he makes a good point regarding some things you may use in Preview.

Upvotes: 2

Related Questions