My application takes too long to show how?

Hello my friends. I am having problems with my mobile application that I develop on ionic 3. But to my great disappointment, it takes too much time (16 seconds) to display the first page, when I compile by adding --prod I have errors during compilation. Please tell me how I could optimize this.

Short answer: Use --prod is a must, you will have to solve your compilation errors

Error: ./src/app/main.ts
Module not found: Error: Can’t resolve ‘./app.module.ngfactory’ in 'C:\Users\All lox cost\Desktop\bbZPP\src\app’
resolve ‘./app.module.ngfactory’ in 'C:\Users\All lox cost\Desktop\bbZPP\src\app’
using description file: C:\Users\All lox cost\Desktop\bbZPP\package.json (relative path: ./src/app)
Field ‘browser’ doesn’t contain a valid alias configuration
after using description file: C:\Users\All lox cost\Desktop\bbZPP\package.json (relative path: ./src/app)
using description file: C:\Users\All lox cost\Desktop\bbZPP\package.json (relative path: ./src/app/app.module.ngfactory)
no extension
Field ‘browser’ doesn’t contain a valid alias configuration
C:\Users\All lox cost\Desktop\bbZPP\src\app\app.module.ngfactory doesn’t exist
.ts
Field ‘browser’ doesn’t contain a valid alias configuration
C:\Users\All lox cost\Desktop\bbZPP\src\app\app.module.ngfactory.ts doesn’t exist
.js
Field ‘browser’ doesn’t contain a valid alias configuration
C:\Users\All lox cost\Desktop\bbZPP\src\app\app.module.ngfactory.js doesn’t exist
.json
Field ‘browser’ doesn’t contain a valid alias configuration
C:\Users\All lox cost\Desktop\bbZPP\src\app\app.module.ngfactory.json doesn’t exist
as directory
C:\Users\All lox cost\Desktop\bbZPP\src\app\app.module.ngfactory doesn’t exist
[C:\Users\All lox cost\Desktop\bbZPP\src\app\app.module.ngfactory]
[C:\Users\All lox cost\Desktop\bbZPP\src\app\app.module.ngfactory.ts]
[C:\Users\All lox cost\Desktop\bbZPP\src\app\app.module.ngfactory.js]
[C:\Users\All lox cost\Desktop\bbZPP\src\app\app.module.ngfactory.json]
[C:\Users\All lox cost\Desktop\bbZPP\src\app\app.module.ngfactory]
@ ./src/app/main.ts 2:0-60
at new BuildError (C:\Users\All lox cost\Desktop\bbZPP\node_modules@ionic\app-scripts\dist\util\errors.js:16:28)
at callback (C:\Users\All lox cost\Desktop\bbZPP\node_modules@ionic\app-scripts\dist\webpack.js:121:28)
at emitRecords.err (C:\Users\All lox cost\Desktop\bbZPP\node_modules\webpack\lib\Compiler.js:269:13)
at Compiler.emitRecords (C:\Users\All lox cost\Desktop\bbZPP\node_modules\webpack\lib\Compiler.js:375:38)
at emitAssets.err (C:\Users\All lox cost\Desktop\bbZPP\node_modules\webpack\lib\Compiler.js:262:10)
at applyPluginsAsyncSeries1.err (C:\Users\All lox cost\Desktop\bbZPP\node_modules\webpack\lib\Compiler.js:368:12)
at next (C:\Users\All lox cost\Desktop\bbZPP\node_modules\tapable\lib\Tapable.js:218:11)
at Compiler.compiler.plugin (C:\Users\All lox cost\Desktop\bbZPP\node_modules\webpack\lib\performance\SizeLimitsPlugin.js:99:4)
at Compiler.applyPluginsAsyncSeries1 (C:\Users\All lox cost\Desktop\bbZPP\node_modules\tapable\lib\Tapable.js:222:13)
at Compiler.afterEmit (C:\Users\All lox cost\Desktop\bbZPP\node_modules\webpack\lib\Compiler.js:365:9)

Maybe Field 'browser' doesn't contain a valid alias configuration

@reedrichards
My friend I did not find a satisfactory answer for my problem

Have you try reinstalling all the libs (rm -r node_modules / npm install) and also removing and adding the platform again?

otherwise to be honest I don’t know

Good evening, please, I still have problems when I compile with --prod. I have the following errors that show

C:\Users\LARUMEUR\Desktop\appLastSave>ionic cordova build android --prod
Running app-scripts build: --prod --platform android --target cordova
[21:14:03]  build prod started ...
[21:14:03]  clean started ...
[21:14:03]  clean finished in 297 ms
[21:14:03]  copy started ...
[21:14:05]  deeplinks started ...
[21:14:06]  deeplinks finished in 516 ms
[21:14:06]  ngc started ...
[21:14:31]  ngc finished in 25.56 s
[21:14:31]  preprocess started ...
[21:14:31]  preprocess finished in less than 1 ms
[21:14:31]  webpack started ...
[21:14:34]  copy finished in 30.81 s
Error: ./src/app/main.ts
Module not found: Error: Can't resolve './app.module.ngfactory' in 'C:\Users\LARUMEUR\Desktop\appLastSave\src\app'
resolve './app.module.ngfactory' in 'C:\Users\LARUMEUR\Desktop\appLastSave\src\app'
  using description file: C:\Users\LARUMEUR\Desktop\appLastSave\package.json (relative path: ./src/app)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: C:\Users\LARUMEUR\Desktop\appLastSave\package.json (relative path: ./src/app)
    using description file: C:\Users\LARUMEUR\Desktop\appLastSave\package.json (relative path: ./src/app/app.module.ngfactory)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\LARUMEUR\Desktop\appLastSave\src\app\app.module.ngfactory doesn't exist
      .ts
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\LARUMEUR\Desktop\appLastSave\src\app\app.module.ngfactory.ts doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\LARUMEUR\Desktop\appLastSave\src\app\app.module.ngfactory.js doesn't exist
      .json
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\LARUMEUR\Desktop\appLastSave\src\app\app.module.ngfactory.json doesn't exist
      as directory
        C:\Users\LARUMEUR\Desktop\appLastSave\src\app\app.module.ngfactory doesn't exist
[C:\Users\LARUMEUR\Desktop\appLastSave\src\app\app.module.ngfactory]
[C:\Users\LARUMEUR\Desktop\appLastSave\src\app\app.module.ngfactory.ts]
[C:\Users\LARUMEUR\Desktop\appLastSave\src\app\app.module.ngfactory.js]
[C:\Users\LARUMEUR\Desktop\appLastSave\src\app\app.module.ngfactory.json]
[C:\Users\LARUMEUR\Desktop\appLastSave\src\app\app.module.ngfactory]
 @ ./src/app/main.ts 2:0-60
    at new BuildError (C:\Users\LARUMEUR\Desktop\appLastSave\node_modules\@ionic\app-scripts\dist\util\errors.js:16:28)
    at callback (C:\Users\LARUMEUR\Desktop\appLastSave\node_modules\@ionic\app-scripts\dist\webpack.js:121:28)
    at emitRecords.err (C:\Users\LARUMEUR\Desktop\appLastSave\node_modules\webpack\lib\Compiler.js:269:13)
    at Compiler.emitRecords (C:\Users\LARUMEUR\Desktop\appLastSave\node_modules\webpack\lib\Compiler.js:375:38)
    at emitAssets.err (C:\Users\LARUMEUR\Desktop\appLastSave\node_modules\webpack\lib\Compiler.js:262:10)
    at applyPluginsAsyncSeries1.err (C:\Users\LARUMEUR\Desktop\appLastSave\node_modules\webpack\lib\Compiler.js:368:12)
    at next (C:\Users\LARUMEUR\Desktop\appLastSave\node_modules\tapable\lib\Tapable.js:218:11)
    at Compiler.compiler.plugin (C:\Users\LARUMEUR\Desktop\appLastSave\node_modules\webpack\lib\performance\SizeLimitsPlugin.js:99:4)
    at Compiler.applyPluginsAsyncSeries1 (C:\Users\LARUMEUR\Desktop\appLastSave\node_modules\tapable\lib\Tapable.js:222:13)
    at Compiler.afterEmit (C:\Users\LARUMEUR\Desktop\appLastSave\node_modules\webpack\lib\Compiler.js:365:9)

There are some posts about it on the forum, maybe one of them would provide you the solution?

https://forum.ionicframework.com/search?q=app.module.ngfactory%20order%3Alatest

Maybe your problem is related to this angular issue on github. So I recommend to double check your .html templates, if there are missing curly braces or brackets.

Take a look at https://github.com/angular/angular-cli/issues/8036