Angular-cli: ERROR with @types/core-js

Created on 31 Aug 2016  路  8Comments  路  Source: angular/angular-cli

Please provide us with the following information:

I was adding @typings/core-js to solve 'Can't find Promise' problem following the answer:
http://stackoverflow.com/questions/35660498/angular-2-rc-5-cant-find-promise

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
    Win10
  2. Versions. Please run ng --version. If there's nothing outputted, please run
    in a Terminal: node --version and paste the result here:
angular-cli: local (v1.0.0-beta.11-webpack.8, branch: master)
node: 6.4.0
os: win32 x64
  1. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.
  2. The log given by the failure. Normally this include a stack trace and some
    more information.
    Errors show when ng build:
...
1ms additional asset processing
4697ms chunk asset optimization
4237ms asset optimization
562ms emitting
Hash: cc59c930643597ef4167
Version: webpack 2.1.0-beta.21
Time: 35420ms
           Asset       Size  Chunks             Chunk Names
  main.bundle.js    3.68 MB    0, 2  [emitted]  main
styles.bundle.js    25.3 kB    1, 2  [emitted]  styles
       inline.js    5.53 kB       2  [emitted]  inline
        main.map    4.45 MB    0, 2  [emitted]  main
      styles.map    34.2 kB    1, 2  [emitted]  styles
      inline.map    5.59 kB       2  [emitted]  inline
      index.html  876 bytes          [emitted]
chunk    {0} main.bundle.js, main.map (main) 3.5 MB {1} [initial] [rendered]
chunk    {1} styles.bundle.js, styles.map (styles) 25.4 kB {2} [initial] [rendered]
chunk    {2} inline.js, inline.map (inline) 0 bytes [entry] [rendered]

ERROR in [default] D:\Tests\angular-cli\node_modules\typescript\lib\lib.es2015.core.d.ts:17:13
Duplicate identifier 'PropertyKey'.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:21:13
Duplicate identifier 'PropertyKey'.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:85:4
All declarations of 'name' must have identical modifiers.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:145:4
Subsequent variable declarations must have the same type.  Variable '[Symbol.unscopables]' must be of type '{ copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: ...', but here has type 'any'.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:262:4
All declarations of 'flags' must have identical modifiers.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:276:4
All declarations of 'EPSILON' must have identical modifiers.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:311:4
All declarations of 'MAX_SAFE_INTEGER' must have identical modifiers.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:318:4
All declarations of 'MIN_SAFE_INTEGER' must have identical modifiers.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:457:4
Subsequent variable declarations must have the same type.  Variable '[Symbol.toStringTag]' must be of type '"Symbol"', but here has type 'string'.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:457:4
All declarations of '[Symbol.toStringTag]' must have identical modifiers.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:464:4
All declarations of 'prototype' must have identical modifiers.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:492:4
All declarations of 'hasInstance' must have identical modifiers.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:498:4
All declarations of 'isConcatSpreadable' must have identical modifiers.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:504:4
All declarations of 'iterator' must have identical modifiers.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:510:4
All declarations of 'match' must have identical modifiers.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:516:4
All declarations of 'replace' must have identical modifiers.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:522:4
All declarations of 'search' must have identical modifiers.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:528:4
All declarations of 'species' must have identical modifiers.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:534:4
All declarations of 'split' must have identical modifiers.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:540:4
All declarations of 'toPrimitive' must have identical modifiers.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:546:4
All declarations of 'toStringTag' must have identical modifiers.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:552:4
All declarations of 'unscopables' must have identical modifiers.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:609:4
Subsequent variable declarations must have the same type.  Variable '[Symbol.toStringTag]' must be of type '"Math"', but here has type 'string'.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:609:4
All declarations of '[Symbol.toStringTag]' must have identical modifiers.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:613:4
Subsequent variable declarations must have the same type.  Variable '[Symbol.toStringTag]' must be of type '"JSON"', but here has type 'string'.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:613:4
All declarations of '[Symbol.toStringTag]' must have identical modifiers.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:628:4
All declarations of 'size' must have identical modifiers.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:634:4
All declarations of 'prototype' must have identical modifiers.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:645:4
All declarations of 'size' must have identical modifiers.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:651:4
All declarations of 'prototype' must have identical modifiers.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:666:4
All declarations of 'prototype' must have identical modifiers.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:680:4
All declarations of 'prototype' must have identical modifiers.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:692:4
All declarations of 'value' must have identical modifiers.

ERROR in [default] D:\Work\IssueCloud\src\webclient\node_modules\@types\core-js\index.d.ts:804:4
All declarations of 'prototype' must have identical modifiers.
Child html-webpack-plugin for "index.html":
         Asset     Size  Chunks       Chunk Names
    index.html  3.26 kB       0
    chunk    {0} index.html 789 bytes [entry] [rendered]
  1. Mention any other details that might be useful.

typescript version: 2.0.0

tsconfig.json:

{
  "compilerOptions": {
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": ["es6", "dom"],
    "mapRoot": "./",
    "module": "es6",
    "moduleResolution": "node",
    "outDir": "../dist/out-tsc",
    "sourceMap": true,
    "target": "es5",
    "typeRoots": [
      "../node_modules/@types"
    ],
    "types": [
      "core-js"
    ]
  }
}


Thanks! We'll be in touch soon.

Most helpful comment

@bruno-serfe I also don't know the reason, Just removed @types/core-js package to solve this problem.

All 8 comments

Hello. Have same issue.

angular-cli: 1.0.0-beta.14
node: 6.6.0
os: darwin x64

I've the following error:

[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:21:14
Duplicate identifier 'PropertyKey'.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:85:5
All declarations of 'name' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:145:5
Subsequent variable declarations must have the same type. Variable '[Symbol.unscopables]' must be of type '{ copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: ...', but here has type 'any'.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:262:5
All declarations of 'flags' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:276:5
All declarations of 'EPSILON' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:311:5
All declarations of 'MAX_SAFE_INTEGER' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:318:5
All declarations of 'MIN_SAFE_INTEGER' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:457:5
Subsequent variable declarations must have the same type. Variable '[Symbol.toStringTag]' must be of type '"Symbol"', but here has type 'string'.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:457:5
All declarations of '[Symbol.toStringTag]' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:464:5
All declarations of 'prototype' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:492:5
All declarations of 'hasInstance' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:498:5
All declarations of 'isConcatSpreadable' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:504:5
All declarations of 'iterator' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:510:5
All declarations of 'match' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:516:5
All declarations of 'replace' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:522:5
All declarations of 'search' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:528:5
All declarations of 'species' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:534:5
All declarations of 'split' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:540:5
All declarations of 'toPrimitive' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:546:5
All declarations of 'toStringTag' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:552:5
All declarations of 'unscopables' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:609:5
Subsequent variable declarations must have the same type. Variable '[Symbol.toStringTag]' must be of type '"Math"', but here has type 'string'.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:609:5
All declarations of '[Symbol.toStringTag]' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:613:5
Subsequent variable declarations must have the same type. Variable '[Symbol.toStringTag]' must be of type '"JSON"', but here has type 'string'.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:613:5
All declarations of '[Symbol.toStringTag]' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:628:5
All declarations of 'size' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:634:5
All declarations of 'prototype' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:645:5
All declarations of 'size' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:651:5
All declarations of 'prototype' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:666:5
All declarations of 'prototype' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:680:5
All declarations of 'prototype' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:692:5
All declarations of 'value' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/@types/core-js/index.d.ts:804:5
All declarations of 'prototype' must have identical modifiers.
[default] /home/vagrant/code/Application/node_modules/typescript/lib/lib.es2015.core.d.ts:17:14
Duplicate identifier 'PropertyKey'.

Can anyone let me know how can I fix this error? because I can't just exclude from the tslint configuration

Thanks

@cuiliang, @bruno-serfe - the issue tracker is for project bugs and project feature requests as noted in CONTRIBUTING.md. For better support, consider creating a question on StackOverflow with all the details.

Hi @cuiliang sorry to bother you with this issue but I've managed to fix lots of another issues but this is still appearing, I was wondering you know the cause of the issue or give me a clue of how to follow this issue. But thanks anyway.

@bruno-serfe I also don't know the reason, Just removed @types/core-js package to solve this problem.

I tried "npm start" to see what packages are conflicting. Mine are es6-promise and @types/core-js both containing identifier 'Promise'. Since I don't need es6-promise, just delete it under directory typings/.

Remove %localappdata%\Microsoft\Typescript, then run: npm install -g [email protected]

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

IngvarKofoed picture IngvarKofoed  路  3Comments

delasteve picture delasteve  路  3Comments

gotschmarcel picture gotschmarcel  路  3Comments

jmurphzyo picture jmurphzyo  路  3Comments

rwillmer picture rwillmer  路  3Comments