Mostefai Mohammed Amine's Blog


Hi and welcome to my blog. I share in this space a lot of posts related to software architecture, and software development. Content is mainly related to .NET CORE development, Angular, Sharepoint, Azure and Office 365. I hope that my articles are helpful and that you enjoy using them 😉

No provider for “SER” after Angular 2 Upgrade

  Certainly, after upgrading Angular 2 to the latest version (starting from RC6), you’ll probably encounter one of the following errors: · “No provider for service XXX” · The component “CCC” does not to module “MMM” A little troubleshooting will indicate that the related files are loaded twice knowing that everything worked just fine before the update. The clue is that the new version of Angular 2 does take in consideration the difference between lowercase and uppercase later in type script import statements. Hence, the two following statements:import {SER} from “./services/ser.service”;   andimport {SER} from “./Services/ser.service”; will be considered as two distinct paths by A2 and will cause the error. The solution is quite simple, if you have such behavior, just analyze that the required file is not loaded twice and if so, locate the import statements that are different in the case sensitive sense. Adopt as a best practice writing all your import statement using lowercase letters and centralizing your exports in a file to minimize the import statements.