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

683
Visualizações
Function calls are not supported in decorators but 'FileTypeModule' was called

trying to setup ngx-formly-material-file, but I got an error: Function calls are not supported in decorators but 'FileTypeModule' was called

I tried to export FileTypeModule, but got the same error

export const fileTypeModule = FileTypeModule.forRoot();

@NgModule({
  imports: [fileTypeModule]

})
over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Have seen this happening many times, last time, with Angular 9, happened during ng build <my-library>, for all modules that were initialized with forRoot

I added in tsconfig.lib.json this and the error went away.

 "angularCompilerOptions": {
    "fullTemplateTypeCheck": true
  }

The fullTemplateTypeCheck compiler switch actually enables the binding expression validation phase of the template compiler. See more details here.

over 4 years ago · Santiago Trujillo Relatório

0

Function calls are not supported in decorators but 'FileTypeModule' was called

I don't have good news about this error message.

It is an issue with Angular 8.2.x and up that introduced limitations on how you can generate metadata for NgModule that are side effects from recent updates to support Ivy.

export const fileTypeModule = FileTypeModule.forRoot();

The only way to fix this error is to modify the function forRoot() from the module. There are strict limitations on what can be done inside that function.

You can not dynamically generate any providers, use arrow functions or conditionally create a NgModule metadata.

This error has a long history now across multiple libraries:

https://github.com/ng-packagr/ng-packagr/issues/727

https://github.com/angular/angular/issues/23609

You can find my specific ways of fixing this problem here:

https://github.com/angular/angular/issues/23609#issuecomment-561615821

If you are not the author for the FileTypeModule the only work around is to contact the author and request that they fix the problem, or you fork the library and make the fixes yourself.

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