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

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

Open
PawelGIX opened this issue Mar 23, 2018 · 4 comments
Open

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

PawelGIX opened this issue Mar 23, 2018 · 4 comments

Comments

@PawelGIX
Copy link

image

@Raathigesh
Copy link
Owner

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?

@scott-cornwell
Copy link

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

@johnhamm
Copy link

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

@johnhamm
Copy link

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

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

4 participants