Search code examples
angulartypescriptangular-upgrade

Angular 9 to 10 upgrade - Typescript compilation warnings : *.ngtypecheck.ts


Post my upgrade from Angular 9 to Angular 10. ng build --prod throws the Typescript compilation unused warnings:

.ts is part of the TypeScript compilation but it's unused. Add only entry points to the 'files' or 'include' properties in your tsconfig.

I have tried all solutions like removing the following include directive from tsconfig.app.json:

    "include": [
    "src/**/*.d.ts"
]

The only workaround that works is setting Ivy to False. But I do not wish to do that and instead want to find the real solution. I did not face it during my upgrade from Angular 8 to 9. Don't know why am bombarded with these warnings when upgrading to 10. Kindly help.


Solution

  • I rolled back and re-upgraded Angular 9 to 10 using automatic migrations. This time my tsconfig got upgraded and I did not see any warnings.

    I think fixing the extends would also work: "extends": "./tsconfig.base.json", if you do not wish to re-upgrade.