1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

Angular CLI Migrated to integrated Nx Monorepo getting several type mismatch errors (error...

Discussão em 'Angular' iniciado por Siobhan Holubicka, Outubro 17, 2024 às 11:42.

  1. I recently moved my Angular CLI to NX workspace monorepo and after fixing all the import errors, it compiled and works as before. However I have over 100 type error, and I have tried to fix individually but it seems to be creating more issues. Here are some examples:

    'myvariable' is possibly 'null'.
    Type 'null' is not assignable to type 'IMyInterface'.
    Type 'string | null' is not assignable to type 'string'.
    Type 'null' is not assignable to type 'SafeHtml'.
    Type 'Observable<(myType| null)[]>' is not assignable to type 'Observable<myType[]>'.
    Type 'MatTableDataSource<T, MatTableDataSourcePaginator>' is not assignable to type 'MatTableDataSource<never, MatTableDataSourcePaginator>'.
    Type 'T[]' is not assignable to type 'never[]'.
    Type 'T' is not assignable to type 'never'.
    Type 'any' is not assignable to type 'never'.


    Nearly every .ts file gives me an error in regards to type. I have tried turning off strict

    "forceConsistentCasingInFileNames": false,
    "strict": false,
    "noImplicitReturns": false,
    "noFallthroughCasesInSwitch": false,
    ...
    "angularCompilerOptions": {
    "strictInjectionParameters": false,
    "strictInputAccessModifiers": false,
    "strictTemplates": false
    }


    Has anyone had this issue before? It is a big project so I cannot include all the code. Is there a way to fix this issue for all or do I have to take each error and fix individually?

    Continue reading...

Compartilhe esta Página