wiretap icon indicating copy to clipboard operation
wiretap copied to clipboard

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

Open PawelGIX opened this issue 7 years ago • 4 comments

image

PawelGIX avatar Mar 23 '18 19:03 PawelGIX

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?

Raathigesh avatar Mar 26 '18 09:03 Raathigesh

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

scott-cornwell avatar Apr 03 '18 23:04 scott-cornwell

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

johnhamm avatar Oct 30 '18 18:10 johnhamm

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?)

johnhamm avatar Oct 30 '18 18:10 johnhamm