Ngx-datatable: Cannot find type definition file for 'core-js'

Created on 30 Aug 2016  路  10Comments  路  Source: swimlane/ngx-datatable

After installed I receive this error:

/node_modules/angular2-data-table/release/models/TableOptions.d.ts:1:1
Cannot find type definition file for 'core-js'.

Missed something?

Investigate

Most helpful comment

@amcdnl Yes. How to solve this issue ?

All 10 comments

  • sigh * - This issue has been reported before, typescript is such a pain

You can use @types/core-js. Install it using npm install --save @types/core-js.

Then add an entry to tsconfig.json:

{
  "compilerOptions": {
    ...
    "typeRoots": [
      "../node_modules/@types"
    ]
  },
   ...
}

Unfortunately it goes in conflict with another one:

/node_modules/@types/core-js/index.d.ts:21:14 
    Duplicate identifier 'PropertyKey'.
/es6-shim/index.d.ts:3:14 
    Duplicate identifier 'PropertyKey'.

I fixed removing mine. I dunno if you want to have that bug open or not or at least update the readme file.
thanks for the support

@daniele-zurico I had the same issue and I followed the same thread. Now I am stuck because I am having Duplicate identifier 'PropertyKey' errors. Please elaborate how did you solve these errors ?

This is happening again??

@amcdnl Yes. How to solve this issue ?

@amcdnl Yes. How to solve this issue ?

@adilmalik393 @neuberfran There are 2 options given by http://blog.mgechev.com/2016/03/28/ambient-type-definitions-duplicate-identifier-typescript-fix/. The preferred option, "Remove core-js from node_modules" doesn't work unfortunately as the ng2-material relies on core-js somehow. I had to "Change es6 to es5" in order to get my app running again.

Add lib:[es5,dom] in your ts config and it works for material as well.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ExTheSea picture ExTheSea  路  3Comments

devendraYebhi picture devendraYebhi  路  3Comments

IngoManthey picture IngoManthey  路  3Comments

Csirme picture Csirme  路  3Comments

TakhirMamirov picture TakhirMamirov  路  3Comments