Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

227
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda