Raathigesh / wiretap

:mag: A desktop app for inspecting mobx and mobx state tree apps
https://wiretap.debuggable.io/
MIT License
202 stars 14 forks source link

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

Open johnhamm opened 6 years ago

johnhamm commented 6 years ago

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;
  }
}