ERROR in Error encountered resolving symbol values statically. Calling function 'PerfectScrollbarModule', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function
Please provide us with the following information:
OS?
Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) Mac OSX
Versions.
Please run
ng --version. If there's nothing outputted, please run in a Terminal:node --versionand paste the result here: cli beta 24
Repro steps.
Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
- generate new project with cli beta 24
- npm install angular2-perfect-scrollbar --save
- import PerfectScrollbarModule.forRoot({suppressScrollX: true})
The log given by the failure.
Normally this include a stack trace and some more information.
ERROR in Error encountered resolving symbol values statically. Calling function 'PerfectScrollbarModule', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AppModule in /.../app.module.ts, resolving symbol AppModule in /..../src/app/app.module.ts
Mention any other details that might be useful.
angular version 2.3.1
Thanks! We'll be in touch soon.
Same issue trying to use angular2-jwt (Json web tokens)
import { AUTH_PROVIDERS } from 'angular2-jwt';

Same issue trying to use angular2-social-login
import { Angular2SocialLoginModule } from "angular2-social-login";
@NgModule({ .... Angular2SocialLoginModule.initWithProviders(providers) });
Error encountered resolving symbol values statically. Calling function 'Angular2SocialLoginModule', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AppModule in '../app.module.ts', resolving symbol AppModule in '../app.module.ts'
what's exactly happening here?
Ok I am back, now I have the same problem with new version 30 of the CLI
I have an example repo that show cases the problem.
"Interestingly" the problem just got worse after the upgrade to beta 30 of the cli - the site will no longer serve the bundled JS (see screenshot below).
With earlier version of the cli (1.0.0-beta.24), at least the bundled files would be served and the site would be functional.
To reproduce:
- Clone the repo: https://github.com/christianacca/ng2-experiements.git
npm installnpm start- browse to http://localhost:4200/

+1
Same here too! A problem with angular2-jwt
I'm using @angular/cli beta30, and I have the same issue with ngx-translate. Similar error appears at the first time running ng serve, but compilation is successful after I just press Ctrl + S to a file again without changing anything, even so the translation works fine. Could be a bug of @angular/cli?
I have the same problem, and when it re-compiles it goes away. How could this issue be closes ?
@NgModule({
providers: [
{
provide: APP_INITIALIZER,
useFactory: test2,
deps: [MainConfigService],
multi: true
},
],...
export function test2(mainConfigService: MainConfigService) {
return function test() {
return mainConfigService.loadConf()
}
}
This issue should not be closed as the error continues
I have the same problem with the FlexLayoutModule. Can't live with it and can't live without it.
Even I am seeing the same error, re compiling the app would make this error disappear.
Removing the .forRoot() on FlexLayoutModule fixed the problem
I confirm the same about FlexLayoutModule, remove .forRoot(). Thanks @nikhildev
More regarding this: https://github.com/angular/angular-cli/issues/3674#issuecomment-279977533
@christianacca I've tried your app and I found something curious. Once you execute ng serve compilation it will fail, but if you do ctrol+s in any of your files, recompilation will trigger again and, boom, it will work. Why is this happening?? Honestly, I don't have any clue yet. We'll have to dig into it.
It is strange agreed!
@wcxaaa commented above - he is getting the same problem. See: https://github.com/angular/angular-cli/issues/3707#issuecomment-279194758)
@robertohuertasm, good luck btw with your digging :-)
@christianacca you're right. I totally missed @wcxaaa's post! Sorry for the redundancy!
I've update @angular/cli to last version (actual in beta.32) and @angular/** (common, compiler, core, forms, http, ...) to last version (actual 2.4.8) and resolve this issue.