wiretap icon indicating copy to clipboard operation
wiretap copied to clipboard

Initializing a property that is an Observable array of string causes "[mobx] Invariant failed: Cannot obtain administration from string 1" error

Open johnhamm opened this issue 7 years ago • 0 comments

Working example:

https://codesandbox.io/s/7j2147k0lj

Adding an array of strings to a store causes an "Invariant failed" error and stops loading the application when Wiretap is used.

2018-10-30 16_29_07-simple mobx todolist - codesandbox

Commenting out the someArray declaration avoids the error

class TodoList {
  @observable todos = [];
  // comment this line to avoid the error
  @observable someArray = ["string 1", "string 2"];
  @computed
  get unfinishedTodoCount() {
    return this.todos.filter(todo => !todo.finished).length;
  }
}

johnhamm avatar Oct 30 '18 20:10 johnhamm