Closed brain-kode closed 6 years ago
Hi @brain-kode,
We have tested the scenario while using the tns preview
command with a shared project, however, we were unabled to reproduce a similar issue. Regarding that, can you provide a sample project, which can be used for recreating the issue?
Note: Using lazy-loaded modules in the project can lead to an issue while staring the project in the preview app. Make sure that you are not using similar modules.
Hi @tsonevn, thank you for your fast reply. This is what I get from compilation of a blank shared project in ubuntu 18.04
Plugin core-js is not included in preview app on device 8d56fdb5-1dfd-4889-8c0c-64e7a7bc70bd and will not work. Start syncing changes for platform android. Copying template files... Platform android successfully added. v5.0.0-rc-2018-10-18-172901-01 Executing before-shouldPrepare hook from /home/gmat/Lavoro/Perso/Test/my-app/hooks/before-shouldPrepare/nativescript-dev-webpack.js Executing before-prepare hook from /home/gmat/Lavoro/Perso/Test/my-app/hooks/before-prepare/nativescript-dev-typescript.js Hook skipped because either bundling or livesync is in progress. Preparing project... Executing before-prepareJSApp hook from /home/gmat/Lavoro/Perso/Test/my-app/hooks/before-prepareJSApp/nativescript-dev-webpack.js Project successfully prepared (android) Executing after-prepare hook from /home/gmat/Lavoro/Perso/Test/my-app/hooks/after-prepare/nativescript-dev-webpack.js Successfully synced changes for platform android. LOG from device ASUS_X00ID: com.tns.NativeScriptException: Application entry point file not found. Please specify the file in package.json otherwise make sure the file index.js or bootstrap.js exists.\nIf using typescript make sure your entry point file is transpiled to javascript. at com.tns.Module.bootstrapApp(Module.java:311) at com.tns.Runtime.run(Runtime.java:544) at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1025) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5423) at android.app.ActivityThread.-wrap2(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:159) at android.app.ActivityThread.main(ActivityThread.java:6139) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) Caused by: com.tns.NativeScriptException: Failed to find module: "./", relative to: app// at com.tns.Module.resolvePathHelper(Module.java:146) at com.tns.Module.bootstrapApp(Module.java:309) ... 12 more
Hi @brain-kode,
After reviewing the error log, I notice that the following warning was printed Plugin core-js is not included in preview app on device
. Keep in mind that using an externaл plugin (such as core-js
) in the preview app is not supported. Here is a list of the plugins, which are included in the Preview app:
"kinvey-nativescript-sdk": "3.11.7",
"nativescript-accelerometer": "2.0.1",
"nativescript-angular": "6.1.0",
"nativescript-background-http": "3.3.0",
"nativescript-camera": "4.0.2",
"nativescript-fresco": "5.0.0",
"nativescript-geolocation": "4.3.0",
"nativescript-imagepicker": "6.0.4",
"nativescript-intl": "3.0.0",
"nativescript-iqkeyboardmanager": "1.3.0",
"nativescript-social-share": "1.5.1",
"nativescript-theme-core": "1.0.4",
"nativescript-ui-autocomplete": "3.9.0",
"nativescript-ui-calendar": "3.8.1",
"nativescript-ui-chart": "3.9.0",
"nativescript-ui-dataform": "3.7.3",
"nativescript-ui-gauge": "3.7.1",
"nativescript-ui-listview": "3.7.0",
"nativescript-ui-sidedrawer": "4.3.0",
If you need using a plugin, which is not included, you should deploy the app on the device using local build.
Hi @tsonevn ,
I didn't install any plugin on my app. I just created a new app with ng new --collection=@nativescript/schematics --name=my-app --shared
and then I did tns preview
core-js is added in package.json when I create a new project. Even if I removed it, I still get the same error.
Hi @brain-kode,
Thank you for your further investigation.
I would suggest waiting for the official release of NativeScript (v 5.0). We will publish a new preview app, with the latest available dependencies versions (latest tns-core-modules, nativescript-angular, etc...).
Currently, you are using a preview app, which at this time depends on NativeScript 4.2, where some of the changes made in 5.0 are not included.
If you are facing a problem after the 5.0 release, you can always open a new issue.
Also, keep in mind that tns preview
is an experimental feature and can be used only for making some test application. For developing a more complex app, please use the local NativeScript setup for building a project or SideKick cloud builds.
It seems tns preview --bundle
will solve this issue
It seems
tns preview --bundle
will solve this issue
Thank you!
tns preview --bundle worked for me
Environment Provide version numbers for the following components (information can be retrieved by running
tns info
in your project folder or by inspecting thepackage.json
of the project):Describe the bug tns preview command crash in an empty angular shared code project
To Reproduce tns preview