question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

In ambient enum declarations member initializer must be constant expression

See original GitHub issue

When I import NgxDatatableModule it gives me below list of errors

ERROR in /Users/manishsharma/My Projects/AngularJS/Prateek/magnitudinis/node_modules/@swimlane/ngx-datatable/release/types/column-mode.type.d.ts (2,16): In ambient enum declarations member initializer must be constant expression.
ERROR in /Users/manishsharma/My Projects/AngularJS/Prateek/magnitudinis/node_modules/@swimlane/ngx-datatable/release/types/column-mode.type.d.ts (3,12): In ambient enum declarations member initializer must be constant expression.
ERROR in /Users/manishsharma/My Projects/AngularJS/Prateek/magnitudinis/node_modules/@swimlane/ngx-datatable/release/types/column-mode.type.d.ts (4,13): In ambient enum declarations member initializer must be constant expression.
ERROR in /Users/manishsharma/My Projects/AngularJS/Prateek/magnitudinis/node_modules/@swimlane/ngx-datatable/release/types/sort.type.d.ts (2,14):In ambient enum declarations member initializer must be constant expression.
ERROR in /Users/manishsharma/My Projects/AngularJS/Prateek/magnitudinis/node_modules/@swimlane/ngx-datatable/release/types/sort.type.d.ts (3,13):In ambient enum declarations member initializer must be constant expression.
ERROR in /Users/manishsharma/My Projects/AngularJS/Prateek/magnitudinis/node_modules/@swimlane/ngx-datatable/release/types/sort-direction.type.d.ts (2,11): In ambient enum declarations member initializer must be constant expression.
ERROR in /Users/manishsharma/My Projects/AngularJS/Prateek/magnitudinis/node_modules/@swimlane/ngx-datatable/release/types/sort-direction.type.d.ts (3,12): In ambient enum declarations member initializer must be constant expression.
ERROR in /Users/manishsharma/My Projects/AngularJS/Prateek/magnitudinis/node_modules/@swimlane/ngx-datatable/release/types/selection.type.d.ts (2,14): In ambient enum declarations member initializer must be constant expression.
ERROR in /Users/manishsharma/My Projects/AngularJS/Prateek/magnitudinis/node_modules/@swimlane/ngx-datatable/release/types/selection.type.d.ts (3,13): In ambient enum declarations member initializer must be constant expression.
ERROR in /Users/manishsharma/My Projects/AngularJS/Prateek/magnitudinis/node_modules/@swimlane/ngx-datatable/release/types/selection.type.d.ts (4,18): In ambient enum declarations member initializer must be constant expression.
ERROR in /Users/manishsharma/My Projects/AngularJS/Prateek/magnitudinis/node_modules/@swimlane/ngx-datatable/release/types/selection.type.d.ts (5,12): In ambient enum declarations member initializer must be constant expression.
ERROR in /Users/manishsharma/My Projects/AngularJS/Prateek/magnitudinis/node_modules/@swimlane/ngx-datatable/release/types/selection.type.d.ts (6,16): In ambient enum declarations member initializer must be constant expression.
ERROR in /Users/manishsharma/My Projects/AngularJS/Prateek/magnitudinis/node_modules/@swimlane/ngx-datatable/release/types/click.type.d.ts (2,14): In ambient enum declarations member initializer must be constant expression.
ERROR in /Users/manishsharma/My Projects/AngularJS/Prateek/magnitudinis/node_modules/@swimlane/ngx-datatable/release/types/click.type.d.ts (3,14): In ambient enum declarations member initializer must be constant expression.
ERROR in /Users/manishsharma/My Projects/AngularJS/Prateek/magnitudinis/node_modules/@swimlane/ngx-datatable/release/types/contextmenu.type.d.ts (2,14): In ambient enum declarations member initializer must be constant expression.
ERROR in /Users/manishsharma/My Projects/AngularJS/Prateek/magnitudinis/node_modules/@swimlane/ngx-datatable/release/types/contextmenu.type.d.ts (3,12): In ambient enum declarations member initializer must be constant expression.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:39 (24 by maintainers)

github_iconTop GitHub Comments

13reactions
wizarrccommented, Sep 24, 2017

@angun33 Looks like version >= 10.0.0 only work with Angular 5. If you want to use Angular 4 with no warning from Angular cli, then you must use ngx-datatable 9.3.0 or less.

4reactions
manishsharma1992commented, Sep 30, 2017

Hi @wizarrc / @jasonhjohnson / @dinvlad

I update the typescript version and using angular 4, and its working like magic for me…

Below is the tweaks I did

npm install typescript@latest --save-dev
...
├─┬ @angular/cli@1.3.2
│ └── typescript@2.4.2
└── typescript@2.5.3

└── @swimlane/ngx-datatable@10.2.3

And I added both name and prop attributes in column configuration, below is the snippet

{ name: 'Symbol', prop: 'SYMBOL' },
{ name: 'Trade', prop: 'TRADE' },
{ name: 'Price #1', prop: 'PRICE_1'},
{ name: 'Date #1', prop: 'DATE_1' },
{ name: 'Price #2', prop: 'PRICE_2'},
{ name: 'Date #2', prop: 'DATE_2' },
{ name: 'Cash Futures', prop: 'CASH_FUTURES' },
{ name: 'Exchange', prop: 'EXCHANGE' }
Read more comments on GitHub >

github_iconTop Results From Across the Web

an ambient enum declarations member initializer must be ...
I can second this issue but I believe it's a TS specific error. In ambient enum declarations member initializer must be constant expression....
Read more >
(TS) In 'const' enum declartions member initializer must be ...
Build:In 'const' enum declarations member initializer must be constant expression. Code with error: export declare const enum JSDocTagName { ...
Read more >
an ambient enum declarations member initializer must be ...
I tried to use it with Angular CLI without AOT stuff. But I'm getting a bunch of typescript errors. Can anybody provide me...
Read more >
swimlane/ngx-datatable - Gitter
... (3,12): In ambient enum declarations member initializer must be constant expression. I'm using Angular 4.4.5 and version 10.4.0 of ngx-datatable.
Read more >
Ionic 3 typescript errors - SDKs - #sentry
... line: 6 [app-scripts] In ambient enum declarations member initializer must be constant expression. [app-scripts] L3: Fatal = "fatal", ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found