Angular build error in core/src/render3/interfaces

Viewed 1973

While building an Angular 6 app i get a compile error in @angular/core/src/render3/interfaces on line 35. The line is:

   [ACTIVE_INDEX]: number | null;

and the error is: error TS1169: A computed property name in an interface must directly refer to a built-in symbol.

I an using @angular/core@6.1.6. Am I doing something wrong or is this an Angular bug?

1 Answers

Verify that Visual Studio is targeting the correct version of Typescript (as seen in your package.json), then try deleting your node_modules folder, and rerunning npm install.

I believe that this is caused by running Angular 6 with an earlier, incompatible version of typescript (<2.7), because it looks like the ability used by the container.d.ts file (referenced in your error) to use Constant-Named Properties was added in Typescript 2.7. Of course, if it were that simple then ng serve would tell you about the Typescript incompatibility, so I assume that I'm either wrong, or that your environment is playing tricks on you.

See here for a related question.

Related