I have a project in Angular version 8.2.14 and it works without errors. However, when I compile it in production and upload it to the server, it returns the following error for which I cannot find out the reason.
I've searched for errors related to NullInjectorError: StaticInjectorError, but I can't find a solution to this specific problem.
ERROR Error: Uncaught (in promise): NullInjectorError: StaticInjectorError(Hl)[Hv -> e]:
StaticInjectorError(Platform: core)[Hv -> e]:
NullInjectorError: No provider for e!
NullInjectorError: StaticInjectorError(Hl)[Hv -> e]:
StaticInjectorError(Platform: core)[Hv -> e]:
NullInjectorError: No provider for e!
at Ve.get (core.js.pre-build-optimizer.js:855:27)
at core.js.pre-build-optimizer.js:17514:24
at e (core.js.pre-build-optimizer.js:17466:1)
at Qt.get (core.js.pre-build-optimizer.js:17438:1)
at core.js.pre-build-optimizer.js:17514:24
at e (core.js.pre-build-optimizer.js:17466:1)
at Qt.get (core.js.pre-build-optimizer.js:17438:1)
at Wi (core.js.pre-build-optimizer.js:30393:29)
at hr.get (core.js.pre-build-optimizer.js:31578:16)
at Lr (core.js.pre-build-optimizer.js:32143:45)
at v (zone-evergreen.js.pre-build-optimizer.js:797:31)
at v (zone-evergreen.js.pre-build-optimizer.js:754:17)
at zone-evergreen.js.pre-build-optimizer.js:858:17
at a.invokeTask (zone-evergreen.js.pre-build-optimizer.js:391:31)
at Object.onInvokeTask (core.js.pre-build-optimizer.js:39680:33)
at a.invokeTask (zone-evergreen.js.pre-build-optimizer.js:390:60)
at s.runTask (zone-evergreen.js.pre-build-optimizer.js:168:47)
at _ (zone-evergreen.js.pre-build-optimizer.js:559:35)
However, if I compile the project in development and upload it to the server, it works perfectly.
I have tried to search for the problem but I can't find it. Another option would be to change the version of Angular but the project is quite large and I don't want to do the long work so that it keeps giving me the same error without knowing the reason.