Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 this issue Oct 30, 2018 · 0 comments

Comments

@johnhamm
Copy link

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;
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant