Store: A computed property name in an interface must directly refer to a built-in symbol.

Created on 4 May 2018  路  10Comments  路  Source: ngxs/store

* "@ngxs/store": "^3.0.0-rc.4",
*  "@angular/core": "5.2.9",
* "@ionic-native/core": "4.4.0",

Repro steps

  • ionic serve (mainly the same as ng serve)

Observed behavior

[09:29:51] typescript: .../node_modules/@ngxs/store/src/internals.d.ts, line: 7
A computed property name in an interface must directly refer to a built-in symbol.

   L6:  export interface StateClass {
   L7:      [META_KEY]?: MetaDataModel;

Desired behavior

compiles and run properly

Mention any other details that might be useful (optional)

In case someone has faced this before. Right now am busy updating packages one by one hoping it solves the issue.

All 10 comments

Replacing META_KEY with its actual string value enables to continue working, but isn't a real solution:

@ngxs\store\src\internals.d.ts line 6:

export interface StateClass {
  NGXS_META?: MetaDataModel;
}

@Thenis indeed but in my case (ionic 3.x) it's not an option to consider upgrading angular to 6.x. So I'm stuck with Typescript < 2.7.

@Dercetech you can rollback to 3.0.0-rc.1 as a temporal fix until you can upgrade to Angular 6.x

This is typescript version mismatch, closing for now.

What typescript version do we need here please? How can I find out which one I got to use for my Angular version?

@woeterman94 For NGXS 3+ you need TypeScript 2.7+. Angular 6 and above have TypeScript 2.7. You can check your package.json to see what version you have

Remember to remove package-lock.json after upgrading typescript.

@joaocagnoni Why would you have to remove the package-lock.json file after updating typescript?

Yeah indeed, I don't understand how that would solve anything?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

piernik picture piernik  路  5Comments

ToxicToast picture ToxicToast  路  6Comments

michael42 picture michael42  路  4Comments

paulstelzer picture paulstelzer  路  5Comments

malfusion picture malfusion  路  4Comments