Search code examples
angulartypescriptintellij-ideawebstormangular-cli

Error encountered resolving symbol values statically. Calling function 'SimpleNotificationsModule'


I've installed angular2-notifications in my Angular 4 project and everything went fine, but when I changed machine I got the following issue when trying to compile using ng serve:

ERROR in Error: Error encountered resolving symbol values statically. Calling function 'SimpleNotificationsModule', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AppModule in myapp/src/app/app.module.ts, resolving symbol AppModule in myapp/src/app/app.module.ts


Solution

  • After some reading about similar issues on github I finally found the solution:

    For some reason IntelliJ/Webstorm tend to import this package as:

    import { SimpleNotificationsModule } from 'angular2-notifications/dist';
    

    It should be instead:

    import { SimpleNotificationsModule } from 'angular2-notifications';
    

    thanks MattsSe for posting this solution on GitHub.