Typescript 1.5 - 'Duplicate identifier' errors

728 views Asked by At

I created a very simplistic project with Typescript 1.5.0 beta and included threejs/three typings with tsd. When compiling, tsc outputs 128 errors regarding Duplicate Identifier 'identifier'. I'm not sure if 128 is just where tsc starts truncating errors, so there could be more...

I started the project by creating a blank folder, and creating app.ts and index.html. Then I installed threejs/three using the following command:

tsd install threejs/three -rso

In my app.ts I only added the following line, and compiled:

/// <reference path="typings/tsd.d.ts"/>

For now, compilation from the command line should suffice, and I'm using the following command:

tsc --module commonjs --target es5 ./app.ts

Here's link to the full list of errors I'm getting from tsc:

https://gist.github.com/josefvanniekerk/24496b480bf488db522d

Any idea why tsc complaining?

1

There are 1 answers

0
zlumer On BEST ANSWER

The problem is in typings/webaudioapi/waa.d.ts. TypeScript 1.5 includes Web Audio API declarations internally and you get duplicate identifiers.

To solve the problem, remove the typings/webaudioapi/waa.d.ts file and remove the reference to it from typings/tsd.d.ts

In previous versions of TypeScript compiler this file was not included and errors didn't show up.