0

searching the whole morning for a solution...

I use typescript on (node, npm, bower and gulp). On gulp serve / gulp test I got hundreds of same error message:

src\app\main\common\dialogs\collections\collections.controller.ts(1,8): error TS2300: Duplicate identifier 'IDialogService'.
src\app\main\common\dialogs\createproject\createprojectdialog.controller.ts(1,8): error TS2300: Duplicate identifier 'ILogService'.
src\app\main\common\dialogs\datasheet\create\controller.ts(1,8): error TS2300: Duplicate identifier 'IDialogService'.
src\app\main\common\dialogs\decisor\controller.ts(1,8): error TS2300: Duplicate identifier 'IDialogService'.

my Compiler Options:

{
  "compilerOptions": {
    "module": "commonjs",
    "target": "es5",
    "sourceMap": true
  },
  "exclude": [
    "node_modules"
  ]
}

Anyone who can give me a hint... ?

regards n00n

n00n
  • 654
  • 1
  • 10
  • 30
  • Possible duplicate http://stackoverflow.com/questions/31322525/typescript-confusing-duplicate-identifier-error-message – Molda Apr 12 '16 at 09:44
  • no, I found your link before, but it could not help to solve my problem... – n00n Apr 12 '16 at 11:23

2 Answers2

0

I see lots of Duplicate identifier 'IDialogService'. I suspect the error is genuine and you are doing something like :

 interface Something {
   IDialogService: Foo;
 }

multiple times in your codebase. You should only have this once.

basarat
  • 261,912
  • 58
  • 460
  • 511
  • Yes, there are many files importing the IDialogService. I do not know if I can import it once... – n00n Apr 15 '16 at 09:42
  • You can `import` it as many times as you want. But you must not define it more than once – basarat Apr 16 '16 at 19:22
0

solved like this

instead of import foo as library.foo; function .. (..., foo, ... )

I used: function .. (..., library.foo, ... )

n00n
  • 654
  • 1
  • 10
  • 30