My app has a lot of TypeScript errors but runs properly (I moved a javascript app to typescript and can't fix all the type issues now...). I've set up my editor (webstorm) to ignore those errors and the app compiles.
Runnning the app (JiT) works well but when I try to compile the app (I have followed this tuto) with AoT I get all the TypeScript errors and the compilation fails. I can't paste all the errors (there are too many) but here is a sample:
Error at C:/app-path/services/app.service.ts:18:23: Property 'saveScroll' does not exist on type 'CanComponentDeactivate'.
Error at C:/app-path/services/app.service.ts:45:20: Parameter 'object' implicitly has an 'any' type.
Error at C:/app-path/services/app.service.ts:48:24: Parameter 'mObject' implicitly has an 'any' type.
Error at C:/app-path/services/app.service.ts:75:30: Property 'value' does not exist on type 'FormBuilder'.
Knowing that I can't currently fix all the errors (but want to keep typescript), what should I do to be able to compile?
In your case the quickest solution is to disable the noImplicitAny
setting in tsconfig.json
. This fixes 2 and 3.
For the other type errors, where the compiler complains about missing properties, you can fall back to casting them to any
.