Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error TS5023: Unknown compiler option 'strictTemplates'

Compiling an angular application (v10) fails with this error.

An unhandled exception occurred: tsconfig.json:14:5 - error TS5023: Unknown compiler option 'strictTemplates'.

14     "strictTemplates": true,
       ~~~~~~~~~~~~~~~~~
like image 875
andymel Avatar asked Mar 11 '21 11:03

andymel


People also ask

Why does typescript error ts5023 say build unknown compiler option?

error TS5023:Build:Unknown compiler option ‘listemittedfiles’. Apparently, the problem was related to a strange option switch used by the Visual Studio 2015’s MSBuild task: , which has been introduced in TypeScript 2.0 and shouldn’t be used with earlier versions of TypeScript such as the one he was using to compile my project, which was 1.7.5.

What is ts5023 error in tsconfig?

An unhandled exception occurred: tsconfig.json:14:5 - error TS5023: Unknown compiler option 'strictTemplates'. 14 "strictTemplates": true, ~~~~~~~~~~~~~~~~~ strictTemplates is a parameter for the angular compiler. In your tsconfig.json: move the parameter inside angularCompilerOptions

Why does Visual Studio 2015 have error ts5023?

error TS5023:Build:Unknown compiler option ‘listemittedfiles’. Apparently, the problem was related to a strange option switch used by the Visual Studio 2015’s MSBuild task:

Should we use strict templates in angular 9?

When strictTemplates is true, Angular 9 and the Ivy compiler verify that hero is a valid model of type Hero, and that the properties on that model ( hero. id and hero. name) are also valid. "Angular 9's Ivy compiler and the strict template check finds errors that Angular 8 could not detect." Should We Use Strict Templates Now?


1 Answers

strictTemplates is a parameter for the angular compiler.

In your tsconfig.json: move the parameter inside angularCompilerOptions

"angularCompilerOptions": {
  ...,
  "strictTemplates": true,
  ...
}

Angular >= 9 is necessary.

More info here: https://angular.io/guide/template-typecheck

like image 182
andymel Avatar answered Nov 15 '22 06:11

andymel