App not displaying for --prod build


#1

I am recently encountering a similar error.

When I run serve/build command with --prod flag and in android/desktop chrome browser - platform ready is not being invoked :S But it works in firefox and edge.

If I run the same commands without --prod flag, it works on all tested platforms.

Ionic info:
global packages:
@ionic/cli-utils : 1.4.0
Cordova CLI : 7.0.0
Ionic CLI : 3.4.0
local packages:
@ionic/app-scripts : 1.3.0
@ionic/cli-plugin-cordova : 1.4.0
@ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms : android 6.0.0
Ionic Framework : ionic-angular 3.3.0
System:
Node : v6.9.2
OS : Windows 10
Xcode : not installed
ios-deploy : not installed
ios-sim : not installed
npm : 3.9.3


Platform.ready Not Firing
#2

What exactly are the commands you use to run/build?
Where and how exactly are you testing?


#3

I have added “build-prod”: “ionic-app-scripts build --prod” to scripts in package.json and I run “npm run build-prod” and after it is done I copy the www folder to the ftp server.
I have done more research, it turns out “platform ready” is firing (I have added a console output) but the web page remains blank, although in console seems like everything has loaded as usual, perhaps the screenshot will be of some use:


#4

It is the same, if I run the app on the device with command "ionic cordova run android --prod"
If I run ionic “cordova run android” it works ok on the Android device as well
(there are less console logs on this screenshot because there are no saved credentials and user would be redirected to the login page)


#5

Did you remote debug the problem on the device already? Follow these instructions here to debug the problem in Chrome dev tools: https://ionic.zone/debug/remote-debug-your-app#android Look at the console and network tabs for errors.


#6

Thanks for the suggestion, but the second screenshot is from the ADB connection to the Android device and chrome developer tools. There is nothing in the network tab as well. Thanks to my colleague, the solution was removing some color entries from the variables.scss as proposed here: https://github.com/ionic-team/ionic-app-scripts/issues/506.


#7

Sorry :confused:

Please add your details to the issue so the team has more information on what to fix.


#8

I removed the additional variables.scss and now it works, so no fix required.


#9

Breakage without no feedback on doing something quite normal should be fixed :slight_smile:


#10

true, but there is already an issue on the github for that …