Raathigesh / wiretap

:mag: A desktop app for inspecting mobx and mobx state tree apps

Home Page:https://wiretap.debuggable.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't connect to store - Maximum call stack size exceeded

PawelGIX opened this issue · comments

The app uses a socket connection to send payload back and forth. This could be because you are trying to send some non-serializable data. Would you be able to provide a sample repo where this is reproducible?

Same problem here. I'm using latest mobx with nested stores, maybe that has something to do with it?

Same here. Using Mobx 5.5.2 and nested stores as well.

Found the issue, but I'm not sure how to fix it.

I have a root store:

export class AppStore {
  @observable uiStore: UiStore;
  @observable otherStore: OtherStore;

  constructor() {
    this.uiStore = new UiStore(this);
    this.otherStore = new OtherStore(this);
  }
  ...
}

export class UiStore {
  constructor(private appStore: AppStore) {}
}

This code causes the "Maximum call stack size exceeded" error above. If I change the code to this:

export class AppStore {
  @observable uiStore: UiStore;
  @observable otherStore: OtherStore;

  constructor() {
    this.uiStore = new UiStore();
    this.otherStore = new OtherStore();
  }
  ...
}

export class UiStore {
  constructor() {}
}

It works, but then I cannot access the root store from the child stores. Is there a way to prevent Wiretap from parsing certain properties of a store (perhaps if they are marked private?)