Getting typescript errors on compilation but not on serve

I am all of a sudden getting the following errors that weren’t there a few days ago.

ERROR in src/app/gap-game/gap-game.page.html(61,75): The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.
src/app/gap-game/gap-game.page.html(60,141): The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.
src/app/transformation-game/transformation-game.page.html(80,86): The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.
src/app/transformation-game/transformation-game.page.html(79,151): The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.
src/app/transformation-game/transformation-game.page.html(91,89): The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.

These don’t make sense; in the first case, 61,75 is a space character. These errors do not show up in either ionic serve or the more complicated way of doing live-reload on-device.

This is the latest Ionic 5, latest cordova, Angular 9 all up to date, TS 3.8.3. Any guidance would be greatly appreciated.

Hmm, so you probably are seeing something with AOT/prod builds.

I’d look in your angular.json and set buildOptimizer to false.
That might be able to provide more information when it’s not mangled up.

Disabling the build optimizer does nothing; I get the same errors. Disabling AOT makes it work, but does not report any errors.

From slack:

Ok apparently it was introduced because of settings in tsconfig that got updated. Specifically

“angularCompilerOptions”: {
   “fullTemplateTypeCheck”: false,
}
1 Like