Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

681
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda