NS + Angular app some times compiles with white screen


#1

My app compiles with white screen

Sometimes the app compiles with white screen and no console error.

Environments

  • Genymotion 2.12.1

Project dependencies below:

"nativescript": {
    "id": "org.nativescript.tabletv2ns",
    "tns-android": {
      "version": "4.0.1"
    }
  },
  "dependencies": {
    "@angular/animations": "~5.2.0",
    "@angular/common": "~5.2.0",
    "@angular/compiler": "~5.2.0",
    "@angular/core": "~5.2.0",
    "@angular/forms": "~5.2.0",
    "@angular/http": "~5.2.0",
    "@angular/platform-browser": "~5.2.0",
    "@angular/platform-browser-dynamic": "~5.2.0",
    "@angular/router": "~5.2.0",
    "nativescript-angular": "~5.2.0",
    "nativescript-drop-down": "^4.0.0",
    "nativescript-localize": "^3.0.3",
    "nativescript-theme-core": "~1.0.4",
    "reflect-metadata": "~0.1.8",
    "rxjs": "~5.5.2",
    "tns-core-modules": "~3.4.0",
    "zone.js": "~0.8.18"
  },
  "devDependencies": {
    "babel-traverse": "6.26.0",
    "babel-types": "6.26.0",
    "babylon": "6.18.0",
    "gts": "^0.5.4",
    "lazy": "1.0.11",
    "nativescript": "^4.0.1",
    "nativescript-dev-typescript": "~0.6.0",
    "tslint": "^5.9.1",
    "typescript": "~2.6.2"
  }

The nativescript is in devDependencies because I’m not using tns command as global dependency on the machine.

Please I need your help to solve that.


#2

Try to lazy load your modules, keep the initial load as minimal as possible. The white screen may be basically the time to load all your modules, it will mostly not happen in webpack build.


#3

Thank you for your answer!

The problem is not slow to carry things but is that sometimes the project is compiled with white screen, ignoring any other component that I put there.

The worst thing is that it does not even generate any bug in the build.