Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

226
Views
ERROR in Error encountered resolving symbol values statically

I just migrated my project under angular-cli and I'm getting this error when I start it:

ERROR in Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function (position 63:45 in the original .ts file), resolving symbol AppModule in C:/Data/Private/Innovation/EV/ev-dashboard/src/app/app.module.ts

Which corresponds to the APP_INITIALIZER below in app.module.ts:

...
providers: [ // expose our Services and Providers into Angular's dependency injection
    APP_PROVIDERS,
    ConfigService,
    { provide: APP_INITIALIZER, useFactory: (config: ConfigService) => () => config.load(), deps: [ConfigService], multi: true }
...

What is funny is that when I comment this line, it starts well and uncomment it afterward which triggers a compilation without error this time!!!

Do you have an idea?

Thanks, Serge.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You need to extract function like:

export function configFactory(config: ConfigService) {
  return () => config.load()
}

...
providers: [{ 
  provide: APP_INITIALIZER, 
  useFactory: configFactory, 
  deps: [ConfigService], 
  multi: true 
}

See also

  • https://github.com/angular/angular/issues/11262

  • Angular4 APP_INITIALIZER won't delay initialization

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!