Ngx-datatable: angular2-data-table.d.ts' is not a module. Please contact the package author to update the package definition

Created on 15 Aug 2016  路  45Comments  路  Source: swimlane/ngx-datatable

release/angular2-data-table.d.ts

line 483
add prefix keyword export is compile success

export declare module "angular2-data-table"

my environment is angular-cli

Bug Investigate

Most helpful comment

One more update, I found out that the

Error: Uncaught (in promise): Template parse errors:
Can't bind to 'row' since it isn't a known property of 'datatable-body-row'.

issue was introduced by rc5, as stated under this: https://github.com/angular/angular/issues/10618

So, the temporary workaround is to add

plugins: [
    ...
    new webpack.optimize.UglifyJsPlugin({ mangle: { screw_ie8 : true, keep_fnames: true } })
]

to webpack.prod.config

All 45 comments

Try now please. This file is generated by the build, need to figure out how to do this automagic for now i manually added

I had the same problem, your commit fixed it. Thanks.

Edit: it introduced several bugs it seems:

`ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(280,18): error TS2304: Cannot find name 'visible'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(281,18): error TS2304: Cannot find name 'curPage'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(285,16): error TS2664: Invalid module name in augmentation, module 'components/header/HeaderCell' cannot be found.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(286,46): error TS2307: Cannot find module '@angular/core'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(287,34): error TS2307: Cannot find module 'services/State'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(288,33): error TS2307: Cannot find module 'models/TableColumn'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(289,35): error TS2307: Cannot find module 'enums/SortDirection'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(295,18): error TS2304: Cannot find name 'sortDir'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(305,16): error TS2664: Invalid module name in augmentation, module 'components/footer/Pager' cannot be found.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(306,46): error TS2307: Cannot find module '@angular/core'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(313,18): error TS2304: Cannot find name 'totalPages'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(325,16): error TS2664: Invalid module name in augmentation, module 'components/body/BodyRow' cannot be found.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(326,32): error TS2307: Cannot find module '@angular/core'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(327,34): error TS2307: Cannot find module 'services/State'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(331,18): error TS2304: Cannot find name 'isSelected'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(338,16): error TS2664: Invalid module name in augmentation, module 'components/body/ProgressBar' cannot be found.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(342,16): error TS2664: Invalid module name in augmentation, module 'utils/deepGetter' cannot be found.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(345,16): error TS2664: Invalid module name in augmentation, module 'components/body/BodyCell' cannot be found.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(346,32): error TS2307: Cannot find module '@angular/core'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(347,33): error TS2307: Cannot find module 'models/TableColumn'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(352,18): error TS2304: Cannot find name 'value'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(353,18): error TS2304: Cannot find name 'width'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(356,16): error TS2664: Invalid module name in augmentation, module 'utils/VisibilityObserver' cannot be found.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(358,19): error TS2304: Cannot find name 'IntersectionObserver'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(367,16): error TS2664: Invalid module name in augmentation, module 'directives/Visibility' cannot be found.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(368,46): error TS2307: Cannot find module '@angular/core'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(376,16): error TS2664: Invalid module name in augmentation, module 'directives/LongPress' cannot be found.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(377,34): error TS2307: Cannot find module '@angular/core'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(388,18): error TS2304: Cannot find name 'press'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(389,18): error TS2304: Cannot find name 'longPress'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(397,16): error TS2664: Invalid module name in augmentation, module 'directives/Resizeable' cannot be found.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(398,46): error TS2307: Cannot find module '@angular/core'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(414,16): error TS2664: Invalid module name in augmentation, module 'directives/Draggable' cannot be found.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(415,46): error TS2307: Cannot find module '@angular/core'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(432,16): error TS2664: Invalid module name in augmentation, module 'directives/Orderable' cannot be found.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(433,34): error TS2307: Cannot find module '@angular/core'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(446,16): error TS2664: Invalid module name in augmentation, module 'directives/Scroller' cannot be found.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(447,65): error TS2307: Cannot find module '@angular/core'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(460,18): error TS2304: Cannot find name 'scrollHeight'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(468,16): error TS2664: Invalid module name in augmentation, module 'directives/TemplateWrapper' cannot be found.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(469,65): error TS2307: Cannot find module '@angular/core'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(484,32): error TS2307: Cannot find module 'enums/ColumnMode'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(485,30): error TS2307: Cannot find module 'enums/SortType'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(486,35): error TS2307: Cannot find module 'enums/SortDirection'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(487,35): error TS2307: Cannot find module 'enums/SelectionType'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(488,34): error TS2307: Cannot find module 'models/TableOptions'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(489,33): error TS2307: Cannot find module 'models/TableColumn'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts
(490,26): error TS2307: Cannot find module 'models/Sort'.

ERROR in path\tonode_modules\angular2-data-table\release\angular2-data-table.d.ts`

Typescript is sooo annoying sometimes! Let me do some research on how to package this, this is a big issue everyone is having.

The problem seems to be with the reference to core-js at the very first line. I've tried to use this file without luck.

https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/core-js/core-js.d.ts

TS1084 on first line
TS2664 on declare module "utils/column"

@amcdnl
0.2.3 is non problem
Thanks!

Was wondering if one of you could do me a favor and try this out - https://github.com/swimlane/angular2-data-table/tree/better-build

This is now on master.

It seems good :)

Finally! LOL

I may have been too fast, sorry ^^

When I do

`import { Angular2DataTableModule } from 'angular2-data-table';

import {
TableOptions,
TableColumn,
ColumnMode
} from 'angular2-data-table';`

I have a ts2307 error: cannot find module angular2-data-table.

However, the table is working well.

Ugh... ok thanks

I found when I did an import for it with 0.2.2 at least the import had to be:
import {Angular2DataTableModule} from "angular2-data-table/release/angular2-data-table";

Edit:
Seems same for 0.2.4

Having other issues but maybe an index.d.ts that has
export * from 'release/angular2-data-table';
might make it import from just 'angular2-data-table'

@DanielRosenwasser Is that the best way? Wouldn't declaring the typings fix this?

Just because I need more context, how exactly do you want users to import your library? Something like this?

import Angular2DataTableModule from "angular2-data-table/release/angular2-data-table";

@DanielRosenwasser Like in this format - https://plnkr.co/edit/TLx2vYlCTLsqcLwvWafd?p=preview

@Tempus35 can you try again today? Might very well be that it was fixed by #67.

The error changed:

ERROR in ...node_modules\angular2-data-table\release\models\TableOptions.d.ts
(1,1): error TS1084: Invalid 'reference' directive syntax.

Removing the

///

suppresses the error. What's strange, though, is that the same line in State.d.ts and sort.d.ts works just fine.

I am defining angular2-data-table in system.config.js as 'angular2-data-table': 'node_modules/angular2-data-table' and implementing it in as import {Angular2DataTableModule} from 'angular2-data-table'

I am getting error 'cannot find module 'angular2-data-table'

We converted our application to RC5.

Please let me know what I need to do?

-Vijay

Please apply the following PRs and let us know if you are still experiencing the issue.

https://github.com/swimlane/angular2-data-table/pull/67
https://github.com/swimlane/angular2-data-table/pull/69

I changed the types to typings , but when I remove from TableOptions.d.ts and made a build it is getting appended in the First line and give the same eror

Error Build:Invalid 'reference' directive syntax in node_modules\angular2-data-table\release\models\TableOptions.d.ts 1

I imported angular2-data-table with webpack by import {Angular2DataTableModule} from 'angular2-data-table/release/angular2-data-table'; and got an exception:

ERROR in /home/fbelov/job/projects-gramant/modeus/modeus-course-catalog/node_modules/angular2-data-table/release/models/TableOptions.d.ts
(1,1): error TS1084: Invalid 'reference' directive syntax.

ERROR in ./~/angular2-data-table/release/components/DataTable.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./datatable.scss in /home/fbelov/job/projects-gramant/modeus/modeus-course-catalog/node_modules/angular2-data-table/release/components
 @ ./~/angular2-data-table/release/components/DataTable.js 18:0-27

Is there any workaround?

For us to continue working if you give the files needed as single directory with package.json .... We can continue to work until the issue is researched and fixed.

Got the same problem :(

import {Angular2DataTableModule} from "angular2-data-table";

leads to the error zone.js:484 Unhandled Promise rejection: Template parse errors: Can't bind to 'rows' since it isn't a known property of 'datatable'.

and

import {Angular2DataTableModule} from "angular2-data-table/release/angular2-data-table";

leads to the error client:47./~/angular2-data-table/release/components/DataTable.js Module not found: Error: Cannot resolve 'file' or 'directory' ./datatable.scss in C:\www\front-portal-v2\node_modules\angular2-data-table\release\components

I'm using typescript 2.0.0 and webpack 1.13.2, my tsconfig.json file is configure to compile to commonjs ES5

Ok so the problem is just that you reference your scss in the source files, you should either use the styles property of the components and use an appropriate loader to transform your scss to css, or not import the scss files in your ts source files, and build the styles separately.

edit: this doesn't fix the thing in the end, I edited the source files to remove those scss declarations, and now I have the nice zone.js:484Unhandled Promise rejection: Template parse errors: Can't bind to 'rows' since it isn't a known property of 'datatable'. error back, I'll keep searching

Ok I went back to the original import {Angular2DataTableModule} from "angular2-data-table"; which worked fine except for the "Template parse error".

I originally imported the module into a submodule where my table is, but it didn't work.
I changed my code to import it into a shared module (that is imported in all my other modules), and I added it to the exports property here as well, and now it works.

I tried to import/export it into my root NgModule but it doesn't work, only the shared module works :-/

@ocombe:

Ok so the problem is just that you reference your scss in the source file

The release/angular2-data-table.js is only for TypeScript defs. The main file uses the umd version and I recommend you use that. In that version the scss, is built straight into the source using rollup.

The bind error is related to the table not init'ing given the error.

I am defining angular2-data-table in system.config.js as 'angular2-data-table': 'node_modules/angular2-data-table' and implementing it in as import {Angular2DataTableModule} from 'angular2-data-table'
Leads to:
ERROR in ...node_modules\angular2-data-table\release\models\TableOptions.d.ts
(1,1): error TS1084: Invalid 'reference' directive syntax.
Removing the
///
leads to
http://localhost:3000/node_modules/angular2-data-table/release/components/datatable.scss.js 404 (Not Found)

ok saw comment @amcdnl after my comment:
'node_modules/angular2-data-table/release': {defaultExtension: 'js',main: 'angular2-data-table.umd.js'}
solves to my project starts again...

I don't know if that will help some of you but we never know..

To fix this error:

ERROR in ...\node_modules\angular2-data-table\release\models\TableOptions.d.ts
(1,1): error TS1084: Invalid 'reference' directive syntax.

I have updated typescript to 2.0.0 - previously in 1.8.0

To fix this error:
Template parse errors: Can't bind to 'rows' since it isn't a known property
I have updated angular to rc5 - previously in rc4

It also raised another error about types core-js not find so I installed @types/core-js via npm

Since I did many trials I wouldn't guaranty the execution order.
Hopefully that helps.

In the sytem.config.js I Implement 'angular2-data-table': 'node_modules/angular2-data-table' and in the shared module I import it as import {Angular2DataTableModule} from "angular2-data-table"; I am getting Build : Invalid 'reference' directive syntax and it is pointing to /// in Tableoption.d.ts.

I am not sure what I need to do have it working. If someone can give me some detail work around that will help. I tried to implement what @GoNode5 mentioned but could not do so. I am not sure where I need to implement it. I also looked into the package.json to see if the version are different and it is rc5 and typescript 2.0.0

It will be helpful if someone can post the code so I can try it out.

Also stuck on this issue, got angular2-data-table/release/models/TableOptions.d.ts(1,1): error TS1084: Invalid 'reference' directive syntax.

I have the same issue with the error: node_modules\angular2-data-table\release\models\TableOptions.d.ts (1,1): error TS1084: Invalid 'reference' directive syntax.

Can you guys try again in latest release 0.3.0 ?

No still Invalid reference directive syntax.

I added 'angular2-data-table': 'node_modules/angular2-data-table' in system. config and Imported in shared module (import {Angular2DataTableModule } from "angular2-data-table";).

When I build I am getting the Invalid reference directive syntax error.

Please let me know If I need to implement differently.

Try the UMD build one.

If I implement like the definition below I am getting the same error Invalid reference directive syntax error.

'angular2-data-table': 'node_modules/angular2-data-table/release/angular2-data-table.umd.js'
import {Angular2DataTableModule } from "angular2-data-table

I dont know If I need to implement in some other way?

As @ben-go mentioned, I was able to resolve error TS1084: Invalid 'reference' directive syntax. by switching to Typescript 2

As my understanding, typescript 2 is still under beta, so for the one who are willing to take risks, here are my steps:

  1. npm install --save-dev typescript@beta
  2. npm install --save-dev @types/core-js @types/jasmine @types/node
  3. rm -r typings* Caution!: I did this to remove old definitions that are no longer needed.
  4. remove "postinstall": "typings install" in packages.json as it is no longer needed also.
  5. add those to tsconfig.json:
"compilerOptions": {
    ...
    "types": [
        "core-js",
        "jasmine",
        "node"
    ]
}

btw, I followed angular doc. If you use starter, you may need to install additional @types accordingly.

U shouldn't need this anymore, can u try w/ latest?

@amcdnl I had just updated to 0.3.3 (previous post was like 0.2.5). Building was fine, but I still got

Error: Uncaught (in promise): Template parse errors:
Can't bind to 'row' since it isn't a known property of 'datatable-body-row'.

during production runtime.

Also, you had mentioned UMD build, but I don't know how to set it up in webpack. any hints? Thx

One more update, I found out that the

Error: Uncaught (in promise): Template parse errors:
Can't bind to 'row' since it isn't a known property of 'datatable-body-row'.

issue was introduced by rc5, as stated under this: https://github.com/angular/angular/issues/10618

So, the temporary workaround is to add

plugins: [
    ...
    new webpack.optimize.UglifyJsPlugin({ mangle: { screw_ie8 : true, keep_fnames: true } })
]

to webpack.prod.config

So I think we are good now :)

C:\Projects\MGM\mandatory-webappnode_modules\angular2-data-table\release\components\body\body-cell.component.d.ts
Error:(9, 5) TS2300: Duplicate identifier 'readonly'.

I have lot errors from angular2-data-table

@TakhirMirzaev can you paste the errors?

I'm getting bunch (around 80) of such errors:
Build: '=' expected. node_modules\angular2-data-table\release\components\body\body-cell.component.d.ts 9
I've grabbed the latest angular2-data-table sources. No clue why that's happening...

What node version...we only support >=6

Was this page helpful?
0 / 5 - 0 ratings