问题
I tried to deploy my Angular 7 web application and it throws an error - Uncaught (in promise): ReferenceError: ngI18nClosureMode is not defined.
The application works fine when run locally.
Did anyone come across this kind of error?
Thanks in advance!
回答1:
This happens mainly because of the inconsistency in package versions. Since you downgraded all versions to match 8.0.0
, the issue was resolved.
I encountered the same problem, where my angular-cli
version was 8.2.1
and others were set to 8.2.7
. Changing everything to 8.2.7
resolved the issue.
Another possibility is that you might encounter No NgModule metadata found for 'AppModule'
issue. This is another one of the problems caused by inconsistency in versions.
Hope this comes handy for you in future.
回答2:
Just posting it incase it might be useful for others - I was able to resolve this issue by downgrading all my @angular/* packages to 8.0.0 and rebuilding.
来源:https://stackoverflow.com/questions/57898373/reference-error-ngi18nclosuremode-is-not-defined