5

OS: Windows Pro 10
Webstorm: ver 11.0.1
AngularJS: ver 2.0.0-alpha.46

WebStorm Settings

  1. Tools – File Watcher: Babal

  2. Language & Frameworks – JavaScript:
    JavaScript language version: ECMAScript 6

  3. Language & Frameworks – TypeScript:
    Enable TypeScript Compiler (checked):
    Use tsconfig.json (checked)

Project structure:

- bin
- node_modules/angular2
- src/tsconfig.json
- package.json

Package.json

{
  "name": "TypeScriptHTMLApp2",
  "version": "1.0.0",
  "dependencies": {
    "angular2": "2.0.0-alpha.46",
    "es6-shim": "^0.33.13",
    "systemjs": "0.19.6"
  },
  "devDependencies": {
    "babel-preset-es2015": "^6.3.13"
  }
}

tsconfig.json

{
  "compilerOptions": {
    "target": "es6",
    "module": "commonjs",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false
  },
  "exclude": [
    "node_modules"
  ]
}

Note: node_modules folder in the webstorm project window, has also been set to 'exclude'.

So webstorm is throwing the following duplicate identifier error messages:

C:\Program Files (x86)\JetBrains\WebStorm 11.0.1\plugins\JavaScriptLanguage\typescriptCompiler\external\lib.es6.d.ts
Error:(3841, 14) TS2300: Duplicate identifier 'PropertyKey'.
Error:(4034, 5) TS2300: Duplicate identifier 'EPSILON'.
Error:(4069, 5) TS2300: Duplicate identifier 'MAX_SAFE_INTEGER'.
Error:(4076, 5) TS2300: Duplicate identifier 'MIN_SAFE_INTEGER'.
Error:(4362, 5) TS2300: Duplicate identifier 'done'.
Error:(4363, 5) TS2300: Duplicate identifier 'value'.
Error:(4592, 5) TS2300: Duplicate identifier 'flags'.
Error:(4620, 5) TS2300: Duplicate identifier 'size'.
Error:(4630, 5) TS2300: Duplicate identifier 'prototype'.
Error:(4647, 5) TS2300: Duplicate identifier 'prototype'.
Error:(4659, 5) TS2300: Duplicate identifier 'size'.
Error:(4669, 5) TS2300: Duplicate identifier 'prototype'.
Error:(4685, 5) TS2300: Duplicate identifier 'prototype'.
Error:(5072, 5) TS2300: Duplicate identifier 'prototype'.
C:\Users\Theo\Documents\WebStorm\Projects\TypeScriptHTMLApp2\TypeScriptHTMLApp2\node_modules\angular2\typings\es6-shim\es6-shim.d.ts
Error:(6, 14) TS2300: Duplicate identifier 'PropertyKey'.
Error:(9, 5) TS2300: Duplicate identifier 'done'.
Error:(10, 5) TS2300: Duplicate identifier 'value'.
Error:(248, 5) TS2300: Duplicate identifier 'EPSILON'.
Error:(283, 5) TS2300: Duplicate identifier 'MAX_SAFE_INTEGER'.
Error:(290, 5) TS2300: Duplicate identifier 'MIN_SAFE_INTEGER'.
Error:(346, 5) TS2300: Duplicate identifier 'flags'.
Error:(498, 5) TS2300: Duplicate identifier 'prototype'.
Error:(561, 5) TS2300: Duplicate identifier 'size'.
Error:(570, 5) TS2300: Duplicate identifier 'prototype'.
Error:(581, 5) TS2300: Duplicate identifier 'size'.
Error:(590, 5) TS2300: Duplicate identifier 'prototype'.
Error:(605, 5) TS2300: Duplicate identifier 'prototype'.
Error:(619, 5) TS2300: Duplicate identifier 'prototype'.

How do I resolve this issue?

Many thanks in advance

4
  • stackoverflow.com/questions/31322525/… ... it's just a guess what the issue may be. Commented Dec 10, 2015 at 10:57
  • Are you using both Babel and Typescript? Probably that's the mistake! You not need Babel, just set "ES5" as target in your tsconfig Commented Dec 10, 2015 at 14:33
  • @Hitmands The issue has been resolved since I upgraded to webstorm 11.0.2 Initially I thought the same thing, but it's a legitimate practice. Doing so my project generates, from the initial .ts files, .js, .js.map, compiled.js, and compiled.js.map files. See the following article for using both typescript and babel compilers: [link]dev.ivogabe.com/combine-typescript-with-babel And here's the initial document I used to setup webstorm with babel: [link] blog.jetbrains.com/webstorm/2015/05/… Commented Dec 10, 2015 at 18:03
  • Hey @TheoG, sincerely i prefer using IDE just as a platform for manage projects (coding, ecc...), but, for building process I use webpack, gulp and tools like these because I need to perform building even in deployment phases :) Commented Dec 10, 2015 at 18:14

1 Answer 1

-2

This happens when BOTH files are open in the editor. If you close one of the files, the error goes away...

Look at here: Webstorm marks duplicate identifier error for variables from separate files

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

1 Comment

Unfortunately, it can also happen outside of that scope. One same symptom does not mean the issue is the same

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.