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.

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.

See original GitHub issue

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]

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:7
  • Comments:31 (7 by maintainers)

github_iconTop GitHub Comments

13reactions
stas-khcommented, Aug 23, 2017

Here are the steps that helped me yesterday to solve the problem:

  1. Open package.json and remove the line where you define typescript dependency and its version
  2. Remove node_modules folder
  3. Remove package-lock.json file (if you use NPM 5+)
  4. Run npm install typescript@latest --save
  5. Run npm install
6reactions
stas-khcommented, Aug 23, 2017

Hi, I had the same issue yesterday

Try to update your TypeScript dependency (should be ^2.4.0). npm i --save typescript

For me it completely solved the problem.

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 >
Ambient Enum Declaration Error - Stack Overflow
It gives me an error on the ng serve console. ... d.ts (4,14): In ambient enum declarations member initializer must be constant expression....
Read more >
swimlane/ngx-datatable - Gitter
type.d.ts (3,13): In ambient enum declarations member initializer must be constant expression. ERROR in /Users/admin/Sites/my_app/node_modules/@swimlane/ngx- ...
Read more >
TypeScript errors and how to fix them
error TS1066: In ambient enum declarations member initializer must be constant expression. Broken Code ❌. 1 2 3 4 5
Read more >
What is enum in TypeScript explain with example?
We can mix numeric enums in computed and constant members (see below). The short story is enums without initializers either need to be...
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