Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Initializers are not allowed in ambient contexts

I upgraded my Angular version from version 2.4.0 to 4.0.0 while compiling, I am getting following errors.

enter image description here

How can I resolve those errors?

like image 303
Pradeep Avatar asked Jun 04 '26 20:06

Pradeep


1 Answers

For me, this problem was caused by The Visual Studio project file referencing the wrong TypeScript compiler version - see my answer at https://stackoverflow.com/a/43963664/236860 and Allen Conway's excellent post.

like image 138
Neilski Avatar answered Jun 06 '26 10:06

Neilski