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

Maximum call stack size exceeded #30

Open
yordis opened this issue Dec 26, 2017 · 6 comments
Open

Maximum call stack size exceeded #30

yordis opened this issue Dec 26, 2017 · 6 comments

Comments

@yordis
Copy link

yordis commented Dec 26, 2017

I just install this to React Native Debugger and I got

bundle.js:9 Uncaught RangeError: Maximum call stack size exceeded

was in this chuck of code

  function i(e, t) {
        var n = null;
        return o(e, function(e) { // here
            e.name === t && (n = e)
        }, function(e) {
            return e.children
        }),
        n
    }

from this function

, function(e, t, n) {
    "use strict";
    function r(e) {
        return e && e.__esModule ? e : {
            default: e
        }
    }
    function o(e, t, n) {
        if (e) {
            t(e);
            var r = n(e);
            if (r)
                for (var i = r.length, a = 0; a < i; a++)
                    o(r[a], t, n)
        }
    }
    function i(e, t) {
        var n = null;
        return o(e, function(e) {
            e.name === t && (n = e)
        }, function(e) {
            return e.children
        }),
        n
    }
    function a(e) {
        var t = arguments.length <= 1 || void 0 === arguments[1] ? {} : arguments[1]
          , n = arguments.length <= 2 || void 0 === arguments[2] ? {
            name: t.key || "state",
            children: []
        } : arguments[2];
        if (!(0,
        c.default)(e) && e && !e.toJS)
            return {};
        var r = t.key
          , o = void 0 === r ? "state" : r
          , u = t.pushMethod
          , p = void 0 === u ? "push" : u
          , f = i(n, o);
        return null === f ? {} : ((0,
        l.default)(e && e.toJS ? e.toJS() : e, function(e, t) {
            var r = e && e.toJS ? e.toJS() : e
              , o = {
                name: t
            };
            if ((0,
            s.default)(r)) {
                o.children = [];
                for (var i = 0; i < r.length; i++) {
                    var l;
                    o.children[p]((l = {
                        name: t + "[" + i + "]"
                    },
                    l[(0,
                    c.default)(r[i]) ? "object" : "value"] = r[i],
                    l))
                }
            } else
                (0,
                c.default)(r) ? o.children = [] : o.value = r;
            f.children[p](o),
            a(r, {
                key: t,
                pushMethod: p
            }, n)
        }),
        n)
    }
    t.__esModule = !0,
    t.default = a;
    var s = r(n(147))
      , c = r(n(758))
      , l = r(n(760))
}
@yordis
Copy link
Author

yordis commented Dec 26, 2017

This was using mobx-state-tree btw, I am not sure if I should be using this to be honest.

@nazrdogan
Copy link

@yordis Did you solve this ? I have same issue.

@nazrdogan
Copy link

nazrdogan commented May 10, 2018

I found the problem. When I combine mulitple store to one and pass when pass root reference to child. it will give this error
For example like this.
i
When I remove this . problem went away. I think RN debugger cannot handle circular dependency.

class UserStore {...}
class TodosStore {...}

class Store {

    constructor() {
        this.user = new UserStore(this);
        this.todos = new TodosStore(this);
    }

}

@yordis
Copy link
Author

yordis commented May 10, 2018

@nazrdogan I am not using Mobx anymore.

@Fsarmento
Copy link

I am having the exact same problem. Did anyone found a way to avoid this error and keep the circular reference shown by @nazrdogan ?

@ValentinBlokhin
Copy link

have the same issue, any progress?

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