0

In development mode everything working but when i'm running my angular 6 app in production mode where it's generating deploying files as shown in the screen shot. enter image description here

It's throwing error shown below and can also bee seen in the screen shot above. The generated main script is trying to return new t where t is not a constructor.

main.8a1f9e821b7c8c76e49b.js:1 Uncaught TypeError: t is not a constructor
at main.8a1f9e821b7c8c76e49b.js:1
at Ao (main.8a1f9e821b7c8c76e49b.js:1)
at main.8a1f9e821b7c8c76e49b.js:1
at new e (main.8a1f9e821b7c8c76e49b.js:1)
at Object.Xo [as createNgModuleRef] (main.8a1f9e821b7c8c76e49b.js:1)
at t.create (main.8a1f9e821b7c8c76e49b.js:1)
at main.8a1f9e821b7c8c76e49b.js:1
at e.invoke (polyfills.b134ad1096bf06acde05.js:1)
at Object.onInvoke (main.8a1f9e821b7c8c76e49b.js:1)
at e.invoke (polyfills.b134ad1096bf06acde05.js:1)

I have commented all the switch statements in my application. Still I'm not able to find out/debug from where it's throwing this exception. Can anyone suggest me how I can fix/debug this problem.? Please let me know if any other inputs required.

Raj Bhatia
  • 1,049
  • 4
  • 18
  • 37
  • maybe this could help you https://stackoverflow.com/questions/45800032/how-to-debug-angular-in-prod-server – Raghav Garg Sep 11 '18 at 09:22
  • This gave me clue to reach actual problem just before "ng build --prod --sourcemaps" started throwing memory issue. Thanks a lot @RaghavGarg. This problem was related to https://github.com/bleenco/ng2-datepicker/issues/335 – Raj Bhatia Sep 12 '18 at 08:08

0 Answers0