ngx-datatable: ERROR in E:/works/ferrari-update/ferrari/Grand/node_modules/@swimlane/ngx-datatable/release/types/column-mode.type.d.ts (2,16): In ambient enum declarations member initializer must be constant expression.
I’m submitting a … (check one with “x”)
[ ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter
Current behavior when i build, these are some typescript errors: ERROR in E:/works/ferrari-update/ferrari/Grand/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 E:/works/ferrari-update/ferrari/Grand/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 E:/works/ferrari-update/ferrari/Grand/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 E:/works/ferrari-update/ferrari/Grand/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 E:/works/ferrari-update/ferrari/Grand/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 E:/works/ferrari-update/ferrari/Grand/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 E:/works/ferrari-update/ferrari/Grand/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 E:/works/ferrari-update/ferrari/Grand/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 E:/works/ferrari-update/ferrari/Grand/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 E:/works/ferrari-update/ferrari/Grand/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 E:/works/ferrari-update/ferrari/Grand/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 E:/works/ferrari-update/ferrari/Grand/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 E:/works/ferrari-update/ferrari/Grand/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 E:/works/ferrari-update/ferrari/Grand/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 E:/works/ferrari-update/ferrari/Grand/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 E:/works/ferrari-update/ferrari/Grand/node_modules/@swimlane/ngx-datatable/release/types/contextmenu.type.d.ts (3,12): In ambient enum declarations member initializer must be constant expression.
Expected behavior build normal
Reproduction of the problem
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
- Table version: 0.8.x
- Angular version: 2.0.x
- Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
- Language: [all | TypeScript X.X | ES6/7 | ES5]
About this issue
- Original URL
- State: open
- Created 7 years ago
- Reactions: 7
- Comments: 31 (7 by maintainers)
Here are the steps that helped me yesterday to solve the problem:
npm install typescript@latest --savenpm installHi, I had the same issue yesterday
Try to update your TypeScript dependency (should be ^2.4.0).
npm i --save typescriptFor me it completely solved the problem.
I can confirm that by generating a blank app using
ng new testapp, adding ngx-datatables withnpm install @swimlane/ngx-datatable@latest --saveadding the import to app.module then you will get the reported error when young buildyou will get lots ofIn ambient enum declarations member initializer must be constant expression.Running
npm install typescript@latest --save-dev(note the use of --save-dev not --save) bumps the typescript version but there is a conflict with the version of typescript linked by@angular-cli@1.3.2because typescript has now jumped to 2.5.2. Perhaps this isn’t an issue with the latest CLI.npm install typescript@2.4.2 --save-devwill avoid the conflict andng buildwill compile as expected.Upgrading from Angular 4.2.4 to 4.3.4:
npm install @angular/core@4.3.4 @angular/animations@4.3.4 @angular/common@4.3.4 @angular/compiler@4.3.4 @angular/forms@4.3.4 @angular/http@4.3.4 @angular/platform-browser@4.3.4 @angular/platform-browser-dynamic@4.3.4 @angular/router@4.3.4 --savenpm install @angular/compiler-cli@4.3.4 @angular/language-service@4.3.4 --save-devand
ng buildstill raises no errors.I hope the above is helpful to someone.
@stas-kh Updading typescript dont fix error for me
But angular/compiler also complains if you use version greater (or equal to) than 2.5.0
Hello ! Same problem hereUpdate: after a restart, update typescript did the trick ! Thanks