0

Have seen other posts but none of the suggested solutions there worked. So I still see these duplicate identifier errors even though I excluded the whole typings folder. typings folder is in the same level of node_modules and bower_components folder

Here's my typings.json as suggested by Angular 2:

{
  "globalDependencies": {
    "core-js": "registry:dt/core-js#0.0.0+20160317120654",
    "es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654",
    "jasmine": "registry:dt/jasmine#2.2.0+20160412134438",
    "node": "registry:dt/node#4.0.0+20160509154515"
  }
}

What do I need to do? :(

PS: I uninstalled the TypeScript for Visual Studio which is version 1.8.6 and just used the npm typescript which is 1.8.10. Previously, they were installed together in my machine but still not works.

enter image description here

4
  • 1
    Did you add a new npm package dependency recently, if so sometimes they can use the /// directive to reference other files in node_modules - I know that I fought this same issue with later versions of TypeScript. The issue is that some packages ship .ts files, and as a result with this "outreach" from the reference in the /// TypeScript finds things multiple times. Commented May 23, 2016 at 11:22
  • actually this is a new project. but i also excluded the npm_modules folder. shouldn't they be not included during the compilation also? Commented May 23, 2016 at 11:31
  • are you using webpack bundle in gulp? Commented May 25, 2016 at 14:19
  • you definitely don't want to exclude your entire typings folder in tsconfig, but that's not causing your problem. Your typings folder looks suspicious though: bootstrap.d.ts and the other files in the top level - how did those get there? My hunch is you c/p'd them manually, and that if you remove them and install properly via typings install your problem will be solved. Commented May 26, 2016 at 0:56

2 Answers 2

1
+100

Your typings are really strange, you should have either es6-shim or core-js, not both of them. node is most probably redundant too.

Personally, i gave up on VS and plugged angular using gulp build file.

Sign up to request clarification or add additional context in comments.

5 Comments

corejs, jasmine and node are the ones seen on angular2 getting started example. i'll try to remove es6shim
Check this discussion for more information github.com/angular/angular/issues/5755
ok so in my typings.json, i'll try to use corejs only. whats in ur typings?
i have es6-shim only.
need to go to work now. will test it later. but if this works out, i will edit that sample >_<
1

Your exclude isn't right. Assuming you are using Typings version 1.0 or later, it should look like this given the screen shot you added.

 "exclude": [
    "node_modules",
    "bower_components",
    "typings/index.d.ts",
    "typings/modules"
  ],

1 Comment

thanks, i just realized it also... but partially correct since i only use 0.8. for lower versions, "exclude": [ "node_modules", "bower_components", - "typings" "typings/browser/ambient", "typings/main/ambient", "typings/browser.d.ts", "typings/main.d.ts" ]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.