TypeScript: Duplicate identifier - NPM with Typings

From @giacomorebonato on August 14, 2016 13:48

  • VSCode Version: Version 1.5.0-insider (1.5.0-insider)
  • OS Version: OS X El Capitan

Steps to Reproduce: I am working on a Typescript front-end project and I am using Firebase 3, which already comes with Typescript Typings in the package.

If I install the Typings separately typings install npm~firebase the intellisense experience in VSCode is great… but during compilation I get the duplicate identifier message, because the typings are present 2 times

ERROR in [default] /Users/grebonato/JavaScript/mino_material/node_modules/firebase/firebase.d.ts:374:2
Duplicate identifier 'export='.

ERROR in [default] /Users/grebonato/JavaScript/mino_material/typings/modules/firebase/index.d.ts:498:0
Duplicate identifier 'export='.

Instead if I don’t install the typings separately, the compilation works fine, but VSCode doesn’t see the typings in the NPM package

firebase

How am I supposed to make VSCode aware of NPM Firebase Typings ?

Copied from original issue: Microsoft/vscode#10517

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 17 (2 by maintainers)

Most upvoted comments

include and exclude are not the right thing to do here. The language service follows the node module resolution process leading it to your package anyways.

add a path mapping instead:

{
    "compilerOptions": {
          "baseUrl": "./",
          "paths": {
                "base_module" : ["custom-types/bad_module_replacement.d.ts"]
          }
    }
}