Ionic build --prod white screen

Hi,

Since yesterday, when I try to run my application with --prod flag, i get a white screen. But when I try to use ionic serve or, ionic DevApp, or ionic build --prod with livereload, it works perfectly.

I think I’ve a mistake in my config or package file but I don’t found it. Anybody can have a look ?

package.json

{
  "name": "LeRugbynistere",
  "version": "0.1.0",
  "author": "Alexandre RIBES",
  "homepage": "http://www.lerugbynistere.fr",
  "private": true,
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@angular/animations": "4.4.4",
    "@angular/common": "4.4.4",
    "@angular/compiler": "4.4.4",
    "@angular/compiler-cli": "4.4.4",
    "@angular/core": "4.4.4",
    "@angular/forms": "4.4.4",
    "@angular/http": "4.4.4",
    "@angular/platform-browser": "4.4.4",
    "@angular/platform-browser-dynamic": "4.4.4",
    "@ionic-native/core": "^4.3.3",
    "@ionic-native/deeplinks": "^4.3.3",
    "@ionic-native/in-app-browser": "^4.3.3",
    "@ionic-native/keyboard": "^4.3.3",
    "@ionic-native/network": "^4.3.3",
    "@ionic-native/social-sharing": "^4.3.3",
    "@ionic-native/splash-screen": "^4.3.3",
    "@ionic-native/status-bar": "^4.3.3",
    "@ionic/pro": "^1.0.12",
    "@ionic/storage": "2.0.1",
    "angular2-jwt": "^0.2.3",
    "chart.js": "^2.7.1",
    "com-sarriaroman-photoviewer": "~1.1.11",
    "cordova-android": "6.3.0",
    "cordova-ios": "4.5.3",
    "cordova-plugin-actionsheet": "^2.3.3",
    "cordova-plugin-console": "^1.1.0",
    "cordova-plugin-device": "^1.1.6",
    "cordova-plugin-device-motion": "^1.2.5",
    "cordova-plugin-google-analytics": "~1.8.3",
    "cordova-plugin-inappbrowser": "^1.7.1",
    "cordova-plugin-ionic-webview": "^1.1.16",
    "cordova-plugin-network-information": "^1.3.3",
    "cordova-plugin-splashscreen": "^4.0.3",
    "cordova-plugin-statusbar": "git+https://github.com/apache/cordova-plugin-statusbar.git",
    "cordova-plugin-whitelist": "^1.3.2",
    "cordova-plugin-x-socialsharing": "^5.2.1",
    "device": "0.3.8",
    "es6-promise-plugin": "^4.1.1",
    "ionic-angular": "^3.8.0",
    "ionic-img-viewer": "^2.7.3",
    "ionic-plugin-deeplinks": "^1.0.15",
    "ionic-plugin-keyboard": "^2.2.1",
    "ionicons": "3.0.0",
    "list": "1.0.0",
    "ng-lazyload-image": "3.3.3",
    "ngx-swiper-wrapper": "^4.6.6",
    "onesignal-cordova-plugin": "^2.2.2",
    "rxjs": "5.4.3",
    "sw-toolbox": "3.6.0",
    "zone.js": "^0.8.18"
  },
  "devDependencies": {
    "@angular/tsc-wrapped": "^4.4.6",
    "@ionic/app-scripts": "^3.0.1",
    "ionic": "3.18.0",
    "typescript": "2.3.4"
  },
  "description": "Application officielle du Rugbynistère",
  "cordova": {
    "plugins": {
      "cordova-plugin-network-information": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-x-socialsharing": {},
      "onesignal-cordova-plugin": {},
      "cordova-plugin-inappbrowser": {},
      "cordova-plugin-device": {},
      "cordova-plugin-device-motion": {},
      "cordova-plugin-ionic-webview": {},
      "cordova-plugin-console": {},
      "cordova-plugin-actionsheet": {},
      "ionic-plugin-keyboard": {},
      "ionic-plugin-deeplinks": {
        "URL_SCHEME": "rugbynistere",
        "DEEPLINK_SCHEME": "http",
        "DEEPLINK_2_SCHEME": "https",
        "DEEPLINK_HOST": "rugbynistere.fr",
        "ANDROID_PATH_PREFIX": "/"
      },
      "cordova-plugin-statusbar": {},
      "cordova-plugin-google-analytics": {},
      "com-sarriaroman-photoviewer": {}
    },
    "platforms": [
      "ios",
      "android"
    ]
  },
  "config": {
    "ionic_purge_unused_fonts": false
  }
}


config.xml

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.ionic.lerugbynistere" version="0.1.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>Rugbynistère</name>
    <description>Application officielle du Rugbynistère</description>
    <author email="lerugbynistere@gmail.com" href="www.lerugbynistere.fr">Le Rugbynistère</author>
    <content src="index.html" />
    <access origin="*" />
    <allow-intent href="*://*.twitter.com/*" />
    <allow-navigation href="https://secure.lerugbynistere.fr/*" />
    <allow-navigation href="http://localhost:8080/*" />
    <preference name="AllowInlineMediaPlayback" value="true" />
    <allow-navigation href="*://*.youtube.com/*" />
    <allow-navigation href="*://*.dailymotion.com/*" />
    <allow-navigation href="*://*.facebook.com/*" />
    <allow-navigation href="*://*.twitter.com/*" />
    <allow-navigation href="*://*.instagram.com/*" />
    <allow-navigation href="http://ionic.local/*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <preference name="webviewbounce" value="false" />
    <preference name="UIWebViewBounce" value="false" />
    <preference name="DisallowOverscroll" value="true" />
    <preference name="android-minSdkVersion" value="16" />
    <preference name="BackupWebStorage" value="none" />
    <preference name="SplashMaintainAspectRatio" value="true" />
    <preference name="FadeSplashScreenDuration" value="300" />
    <preference name="SplashShowOnlyFirstTime" value="false" />
    <preference name="SplashScreen" value="screen" />
    <preference name="SplashScreenDelay" value="3000" />
    <preference name="ShowSplashScreenSpinner" value="false" />
    <preference name="Orientation" value="portrait" />
    <feature name="CDVWKWebViewEngine">
        <param name="ios-package" value="CDVWKWebViewEngine" />
    </feature>
    <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
    <preference name="KeyboardResize" value="true" />
    <preference name="KeyboardResizeMode" value="ionic" />
    <platform name="android">
        <allow-intent href="market:*" />
        <preference name="loadUrlTimeoutValue" value="600000" />
        <preference name="AutoHideSplashScreen" value="false" />
        <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
        <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
        <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
        <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
        <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
        <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
        <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
        <splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
        <splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
        <splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
        <splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
        <splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
        <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
        <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
        <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
        <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
        <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
        <splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <icon height="57" src="resources/ios/icon/icon.png" width="57" />
        <icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
        <icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
        <icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
        <icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" />
        <icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
        <icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" />
        <icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
        <icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" />
        <icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" />
        <icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
        <icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" />
        <icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
        <icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" />
        <icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" />
        <icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
        <icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
        <icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
        <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
        <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
        <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
        <splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
        <splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
        <splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732" />
        <splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
        <splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
        <splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" />
        <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
        <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
        <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
        <splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
        <icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" />
    </platform>
    <allow-navigation href="http://192.168.0.18:8100" />
    <allow-navigation href="http://192.168.0.20:8100" />
    <allow-navigation href="http://169.254.159.246:8100" />
    <engine name="ios" spec="4.5.3" />
    <engine name="android" spec="6.3.0" />
    <plugin name="cordova-plugin-network-information" spec="^1.3.3" />
    <plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
    <plugin name="cordova-plugin-whitelist" spec="^1.3.2" />
    <plugin name="cordova-plugin-x-socialsharing" spec="^5.2.1" />
    <plugin name="onesignal-cordova-plugin" spec="^2.2.2" />
    <plugin name="cordova-plugin-inappbrowser" spec="^1.7.1" />
    <plugin name="cordova-plugin-device" spec="^1.1.6" />
    <plugin name="cordova-plugin-device-motion" spec="^1.2.5" />
    <plugin name="cordova-plugin-ionic-webview" spec="^1.1.16" />
    <plugin name="cordova-plugin-console" spec="^1.1.0" />
    <plugin name="cordova-plugin-actionsheet" spec="^2.3.3" />
    <plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
    <plugin name="ionic-plugin-deeplinks" spec="^1.0.15">
        <variable name="URL_SCHEME" value="rugbynistere" />
        <variable name="DEEPLINK_SCHEME" value="http" />
        <variable name="DEEPLINK_2_SCHEME" value="https" />
        <variable name="DEEPLINK_HOST" value="rugbynistere.fr" />
        <variable name="ANDROID_PATH_PREFIX" value="/" />
    </plugin>
    <plugin name="cordova-plugin-statusbar" spec="git+https://github.com/apache/cordova-plugin-statusbar.git" />
    <plugin name="cordova-plugin-google-analytics" spec="~1.8.3" />
    <plugin name="com-sarriaroman-photoviewer" spec="~1.1.11" />
</widget>

Thanks you so much !

Hi SquallX,
I also face the same problem, my ionic app built with --prod flag giving me white screen of death.
For my case, I found that one of my npm package is the root cause. It is due to ngx-charts package from https://swimlane.gitbooks.io/ngx-charts/.
Maybe you can try to see any new package that you have installed recently that may cause the problem.

Hi Again,
I managed to solved the white screen hung issue by upgrading my angular packages to version 5.0.0.
Then update dev dependencies typescript to version greater than 2.4.

"dependencies": {
    "@angular/animations": "^5.0.1",
    "@angular/common": "^5.0.0",
    "@angular/compiler": "^5.0.0",
    "@angular/compiler-cli": "^5.0.0",
    "@angular/core": "^5.0.0",
    "@angular/forms": "^5.0.0",
    "@angular/http": "^5.0.0",
    "@angular/platform-browser": "^5.0.0",
    "@angular/platform-browser-dynamic": "^5.0.0",
    "@ionic-native/barcode-scanner": "^4.4.0",
    "@ionic-native/bluetooth-serial": "^4.4.0",
    "@ionic-native/core": "^4.4.0",
    "@ionic-native/splash-screen": "^4.4.0",
    "@ionic-native/status-bar": "^4.4.0",
    "@ionic/storage": "^2.1.3",
    "@swimlane/ngx-charts": "^6.1.0",
    "cordova-android": "6.3.0",
    "cordova-ios": "4.5.2",
    "cordova-plugin-bluetooth-serial": "^0.4.7",
    "cordova-plugin-compat": "^1.2.0",
    "cordova-plugin-crosswalk-webview": "^2.3.0",
    "cordova-plugin-device": "1.1.4",
    "cordova-plugin-splashscreen": "^4.1.0",
    "cordova-plugin-statusbar": "^2.3.0",
    "cordova-plugin-whitelist": "1.3.1",
    "cordova-sqlite-storage": "^2.1.2",
    "d3": "^4.11.0",
    "ionic-angular": "^3.9.2",
    "ionic-plugin-keyboard": "~2.2.1",
    "ionicons": "3.0.0",
    "moment": "^2.19.2",
    "ng2-validation": "^3.8.0",
    "phonegap-plugin-barcodescanner": "^6.0.8",
    "rxjs": "^5.5.2",
    "sw-toolbox": "3.6.0",
    "zone.js": "^0.8.18"
  },
  "devDependencies": {
    "@ionic/app-scripts": "^3.1.2",
    "@types/d3": "4.11.0",
    "typescript": "2.4.2"
  },

Hope it helps.

1 Like