Skip to content

Main entry is missing. App cannot be started. Verify app bootstrap. #4942

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
job111 opened this issue Aug 10, 2019 · 3 comments
Closed

Main entry is missing. App cannot be started. Verify app bootstrap. #4942

job111 opened this issue Aug 10, 2019 · 3 comments

Comments

@job111
Copy link

job111 commented Aug 10, 2019

started facing this problem after migrating to Cli 6.6.0

@DimitarTachev
Copy link
Contributor

@job111. please follow the issue template and provide the required versions and logs in order to allow us to investigate it further. Most probably the issue is caused by some Webpack compilation errors.

@ace-zhang18
Copy link

ace-zhang18 commented Sep 7, 2019

I'm having the same issue. Here's the stacktrace when loading to emulator:

EDIT: It's also happening when I try to run on my device.

NOTE: This is on a freshly migrated Angular project. All the tns.html files have nothing added to them.

Version 6.1.0

steps to reproduce: run tns run anroid, emulator or physical device.

ERROR in src/app/app.module.ts:7:31 - error TS2307: Cannot find module '..homehome.component'.

7 import { HomeComponent } from '..\home\home.component';
                                ~~~~~~~~~~~~~~~~~~~~~~~~
src/app/app.module.ts:8:34 - error TS2307: Cannot find module '..playersplayers.component'.

8 import { PlayersComponent } from '..\players\players.component';
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/app/app.module.ts:9:38 - error TS2307: Cannot find module '..playersplayers-homeplayers-home.component'.

9 import { PlayersHomeComponent } from '..\players\players-home\players-home.component';
                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/app/app.module.ts:10:39 - error TS2307: Cannot find module '..playersplayers-loginplayers-login.component'.

10 import { PlayersLoginComponent } from '..\players\players-login\players-login.component';
                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/app/app.module.ts:11:42 - error TS2307: Cannot find module '..playersplayers-registerplayers-register.component'.

11 import { PlayersRegisterComponent } from '..\players\players-register\players-register.component';
                                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/app/app.module.ts:12:40 - error TS2307: Cannot find module '..playersplayers-searchplayers-search.component'.

12 import { PlayersSearchComponent } from '..\players\players-search\players-search.component';
                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/app/app.module.ts:13:38 - error TS2307: Cannot find module '..      ournaments      ournaments.component'.

13 import { TournamentsComponent } from '..\tournaments\tournaments.component';
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/app/app.module.ts:14:44 - error TS2307: Cannot find module '..      ournaments      ournaments-create       ournaments-create.component'.

14 import { TournamentsCreateComponent } from '..\tournaments\tournaments-create\tournaments-create.component';
                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/app/app.module.ts:15:47 - error TS2307: Cannot find module '..      ournaments      ournaments-dashboard    ournaments-dashboard.component'.

15 import { TournamentsDashboardComponent } from '..\tournaments\tournaments-dashboard\tournaments-dashboard.component';
                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/app/app.module.ts:16:45 - error TS2307: Cannot find module '..      ournaments      ournaments-profile      ournaments-profile.component'.

16 import { TournamentsProfileComponent } from '..\tournaments\tournaments-profile\tournaments-profile.component';
                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/app/app.module.ts:17:44 - error TS2307: Cannot find module '..      ournaments      ournaments-search       ournaments-search.component'.

17 import { TournamentsSearchComponent } from '..\tournaments\tournaments-search\tournaments-search.component';
                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/app/players/players-login/players-login.component.ts:6:37 - error TS2307: Cannot find module 'src/app/players/players-login/players-login.service'.

6 import { PlayersLoginService } from 'src/app/players/players-login/players-login.service';
                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/app/players/players-login/players-login.service.ts:5:25 - error TS2307: Cannot find module 'src/app/globals'.

5 import { Globals } from 'src/app/globals';
                          ~~~~~~~~~~~~~~~~~
src/app/players/players-register/players-register.service.ts:7:25 - error TS2307: Cannot find module 'src/app/globals'.

7 import { Globals } from 'src/app/globals';
                          ~~~~~~~~~~~~~~~~~
src/app/players/players-search/players-search.service.ts:6:25 - error TS2307: Cannot find module 'src/app/globals'.

6 import { Globals } from 'src/app/globals';
                          ~~~~~~~~~~~~~~~~~
src/app/tournaments/tournaments-create/tournaments-create.service.ts:7:25 - error TS2307: Cannot find module 'src/app/globals'.

7 import { Globals } from 'src/app/globals';
                          ~~~~~~~~~~~~~~~~~
src/app/tournaments/tournaments-profile/tournaments-profile.service.ts:7:25 - error TS2307: Cannot find module 'src/app/globals'.

7 import { Globals } from 'src/app/globals';
                          ~~~~~~~~~~~~~~~~~
src/app/tournaments/tournaments-search/tournaments-search.service.ts:7:25 - error TS2307: Cannot find module 'src/app/globals'.

7 import { Globals } from 'src/app/globals';
                          ~~~~~~~~~~~~~~~~~


ERROR in ./app.css
Module not found: Error: Can't resolve 'nativescript-theme-core/css/core.light.css' in 'C:\Users\Ace\eclipse-workspace\arenamaster\src'
 @ ./app.css 3:10-114
 @ ../node_modules/nativescript-dev-webpack/load-application-css-angular.js
 @ ./main.ts
Webpack compilation complete. Watching for file changes.
Webpack build done!
Project successfully prepared (android)
Successfully transferred runtime.js on device emulator-5554.
Restarting application on device emulator-5554...
JS: Error: Could not load CSS from app.css: Error: Cannot find module '-!../node_modules/css-loader/dist/cjs.js??ref--6-1!nativescript-theme-core/css/core.light.css'
JS: HMR: Hot Module Replacement Enabled. Waiting for signal.
Successfully synced application org.nativescript.ngsample on device emulator-5554.
System.err: An uncaught Exception occurred on "main" thread.
System.err: Unable to start activity ComponentInfo{org.nativescript.ngsample/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Calling js method onCreate failed
System.err: Error: Main entry is missing. App cannot be started. Verify app bootstrap.
System.err:
System.err: StackTrace:
System.err: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.nativescript.ngsample/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Calling js method onCreate failed
System.err: Error: Main entry is missing. App cannot be started. Verify app bootstrap.
System.err:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
System.err:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
System.err:     at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
System.err:     at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
System.err:     at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
System.err:     at android.os.Handler.dispatchMessage(Handler.java:106)
System.err:     at android.os.Looper.loop(Looper.java:193)
System.err:     at android.app.ActivityThread.main(ActivityThread.java:6669)
System.err:     at java.lang.reflect.Method.invoke(Native Method)
System.err:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
System.err: Caused by: com.tns.NativeScriptException: Calling js method onCreate failed
System.err: Error: Main entry is missing. App cannot be started. Verify app bootstrap.
System.err:     at com.tns.Runtime.callJSMethodNative(Native Method)
System.err:     at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1242)
System.err:     at com.tns.Runtime.callJSMethodImpl(Runtime.java:1122)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1109)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1089)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1081)
System.err:     at com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:19)
System.err:     at android.app.Activity.performCreate(Activity.java:7136)
System.err:     at android.app.Activity.performCreate(Activity.java:7127)
System.err:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
System.err:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
System.err:     ... 11 more

Here's my package.json

{
  "name": "arenamaster",
  "version": "0.0.0",
  "scripts": {
    "android": "tns run android --bundle",
    "ios": "tns run ios --bundle",
    "mobile": "tns run --bundle",
    "preview": "tns preview --bundle",
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "nativescript-angular": "8.2.1",
    "nativescript-theme-core": "~2.0.17",
    "reflect-metadata": "~0.1.13",
    "tns-core-modules": "~6.1.0",
    "@angular/animations": "8.2.5",
    "@angular/common": "8.2.5",
    "@angular/compiler": "~8.2.5",
    "@angular/core": "8.2.5",
    "@angular/forms": "8.2.5",
    "@angular/platform-browser": "8.2.5",
    "@angular/platform-browser-dynamic": "8.2.5",
    "@angular/router": "8.2.5",
    "@nativescript/schematics": "^0.6.0",
    "angular-in-memory-web-api": "^0.9.0",
    "core-js": "^3.2.1",
    "ngx-ez": "^0.2.6",
    "rxjs": "~6.5.3",
    "tslib": "^1.10.0",
    "zone.js": "0.10.2",
    "@angular/http": "8.0.0-beta.10"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.803.3",
    "@angular/cli": "~8.3.3",
    "@angular/compiler-cli": "8.2.5",
    "@angular/language-service": "~8.2.5",
    "@nativescript/schematics": "~0.7.1",
    "@types/jasmine": "~3.4.0",
    "@types/jasminewd2": "~2.0.6",
    "@types/node": "~12.7.4",
    "codelyzer": "~5.1.0",
    "jasmine-core": "~3.4.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.3.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~2.1.0",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.2",
    "nativescript-dev-webpack": "^1.2.0",
    "protractor": "~5.4.2",
    "ts-node": "~8.3.0",
    "tslint": "~5.19.0",
    "typescript": "3.5.3",
    "webpack-cli": "^3.3.8"
  },
  "nativescript": {
    "id": "org.nativescript.ngsample",
    "tns-android": {
      "version": "6.0.0"
    }
  }
}

@Fatme
Copy link
Contributor

Fatme commented Sep 9, 2019

Hey @ace-zhang18,

The problem is the way the files are imported. The following import is not correct:

import { PlayersComponent } from '..\players\players.component';

It should be:

import { PlayersComponent } from '../players/players.component';

Currently NativeScript CLI has an issue when webpack's compilation is not successful - for example when there is a syntax error in the code. In a such situation CLI goes ahead and tries to deploy the application on device. More info can be found here.

I'm closing this issue as a duplicate to #3785.

@Fatme Fatme closed this as completed Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants