ngx-ui: an ambient enum declarations member initializer must be constant expression

I tried to use it with Angular CLI without AOT stuff. But I’m getting a bunch of typescript errors. Can anybody provide me with some guidance on how to fix that?

ERROR in /Users/alexanderkozhevin/Desktop/hypermedia/pheromone/node_modules/@swimlane/ngx-ui/release/components/input/input-types.d.ts (2,12): In ambient enum declarations member initializer must be constant expression.

ERROR in /Users/alexanderkozhevin/Desktop/hypermedia/pheromone/node_modules/@swimlane/ngx-ui/release/components/input/input-types.d.ts (3,14): In ambient enum declarations member initializer must be constant expression.

ERROR in /Users/alexanderkozhevin/Desktop/hypermedia/pheromone/node_modules/@swimlane/ngx-ui/release/components/input/input-types.d.ts (4,16): In ambient enum declarations member initializer must be constant expression.

ERROR in /Users/alexanderkozhevin/Desktop/hypermedia/pheromone/node_modules/@swimlane/ngx-ui/release/components/input/input-types.d.ts (5,16): In ambient enum declarations member initializer must be constant expression.

ERROR in /Users/alexanderkozhevin/Desktop/hypermedia/pheromone/node_modules/@swimlane/ngx-ui/release/components/date-time/date-time.type.d.ts (2,12): In ambient enum declarations member initializer must be constant expression.

ERROR in /Users/alexanderkozhevin/Desktop/hypermedia/pheromone/node_modules/@swimlane/ngx-ui/release/components/date-time/date-time.type.d.ts (3,12): In ambient enum declarations member initializer must be constant expression.

ERROR in /Users/alexanderkozhevin/Desktop/hypermedia/pheromone/node_modules/@swimlane/ngx-ui/release/components/date-time/date-time.type.d.ts (4,16): In ambient enum declarations member initializer must be constant expression.

ERROR in /Users/alexanderkozhevin/Desktop/hypermedia/pheromone/node_modules/@swimlane/ngx-ui/release/components/notification/notification-style.type.d.ts (2,12): In ambient enum declarations member initializer must be constant expression.

ERROR in /Users/alexanderkozhevin/Desktop/hypermedia/pheromone/node_modules/@swimlane/ngx-ui/release/components/notification/notification-style.type.d.ts (3,15): In ambient enum declarations member initializer must be constant expression.

ERROR in /Users/alexanderkozhevin/Desktop/hypermedia/pheromone/node_modules/@swimlane/ngx-ui/release/components/notification/notification-style.type.d.ts (4,13): In ambient enum declarations member initializer must be constant expression.

ERROR in /Users/alexanderkozhevin/Desktop/hypermedia/pheromone/node_modules/@swimlane/ngx-ui/release/components/notification/notification-style.type.d.ts (5,15): In ambient enum declarations member initializer must be constant expression.

ERROR in /Users/alexanderkozhevin/Desktop/hypermedia/pheromone/node_modules/@swimlane/ngx-ui/release/components/notification/notification-style.type.d.ts (6,12): In ambient enum declarations member initializer must be constant expression.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 21 (1 by maintainers)

Most upvoted comments

I installed latest typescript version inside project. Not globally.

npm install typescript@next --save

And it’s working now

npm install typescript@2.4.2–save has saved my day

You need typescript 2.4

According to this comment Angular isn’t compatible with TypeScript 2.4 or 2.5 yet.

I was stoked to try out this grid because ag-grid is crazy bloated and this looks it has just enough features without the bloat. But I get this error as well with a clean Linux build and fresh install of Angular CLI. Why would an angular grid be built for a version of TS that isn’t compatible with Angular? I’ll look for another lightweight grid and maybe revisit this one again in the future. 😦

Hmm, I guess caching problem. Got fixed after I reloaded and restarted everything.

I am looking at the Angular Changelog here: https://github.com/angular/angular/blob/master/CHANGELOG.md

Angular 4.3.4 was made available August 10, 2017 and it supports Typescript 2.4.

You probably want to upgrade now to Typescript 2.4. According to the Changelog, Angular 5 requires it.

npm install typescript@2.4.2–save has saved my day

worked for me

Im having this issue and tried to update ts to 2.4.2. here is my setup. angular/cdk: 5.0.0-rc0 angular/cli: 1.5.0 angular/flex-layout: 2.0.0-beta.11-b01c2d7 angular/material: 5.0.0-rc0 angular-devkit/build-optimizer: 0.0.33 angular-devkit/core: 0.0.20 angular-devkit/schematics: 0.0.35 ngtools/json-schema: 1.1.0 ngtools/webpack: 1.8.0 schematics/angular: 0.1.3 typescript: 2.4.2 webpack: 3.8.1

Still getting the errors

Hah. Nope. That’s weird. So when I comment it out, compile, and then uncomment again. It works. But it keeps giving me these errors.