-1

java spring 5, Angular 8+ with Cli 8+

I have lazy lazy load enable for modules which looks as following and works perfectly fine build with or without --prod flag

{
  path: 'abc'
  loadChildren: () => import('abc.module').then(m => m.abcModule )
}

If server session is expired module loading just blows up and won't do any thing so i added catch block after then as following which builds fine in both with or without prod mode, but with prod mode build when i click on route abc in browser gets following error.

{
      path: 'abc'
      loadChildren: () => import('abc.module').then(m => m.abcModule )
                          .catch( () => window.location.reload() )

    }


Error: Uncaught (in promise): Error: Runtime compiler is not loaded
Error Runtime compiler is not loaded
at Xi.Gi(main-es2015.50abc434343..js)

i am scratching my head not sure about this, can some one help ?

d-man
  • 57,473
  • 85
  • 212
  • 296
  • can you confirm the path for 'abc.module'. Would './abc.module' also work? You might specify "./abc.module" (or whatever the relative to root path to your module is.) – Damian C Feb 13 '20 at 20:51
  • yes it is prefix ./ – d-man Feb 14 '20 at 15:52
  • Can you share your angular.json file. you can just include the build configurations, mostly interested in prod – Damian C Feb 15 '20 at 01:15

1 Answers1

0

problem is solved after i upgraded angular and cli version to 9.

d-man
  • 57,473
  • 85
  • 212
  • 296