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

Too Much Recursion, Windows Firefox #880

Open
shaunpatterson opened this issue Oct 1, 2016 · 4 comments
Open

Too Much Recursion, Windows Firefox #880

shaunpatterson opened this issue Oct 1, 2016 · 4 comments

Comments

@shaunpatterson
Copy link

I'm running into a problem on Window 7 and 10 on basically ALL recent Firefox versions. Even on the most basic of templates (only a few includes, no macros, a few nested if statements) I get "Template error: too much recursion" Has anyone else seen this?

I'll try and get a basic, isolated failing test next week (assuming I can get permission from my employer to post some of our template code).

@vecmezoni
Copy link
Collaborator

Try to check nunjucks from master, issue like this was fixed in #787

@shaunpatterson
Copy link
Author

I've tried the 3.0.0-dev3 branch and I've verified it's using the new waterfall call structure. Unfortunately that didn't solve our issues.

I'll try to get an isolated test soon. Our setup is a bit complicated (babel, webpack, nunjucks-loader) but I think we can strip down something to the barebones.

@shaunpatterson
Copy link
Author

shaunpatterson commented Oct 3, 2016

Well I don't have a standalone test... but turning off jinja2 compat fixed it for me.

I was able to narrow it down to here:

  runtime.memberLookup = function(obj, val, autoescape) { // jshint ignore:line
    //obj = obj || {};

    // If the object is an object, return any of the methods that Python would
    // otherwise provide.
    if (lib.isArray(obj) && ARRAY_MEMBERS.hasOwnProperty(val)) {
      return function() {return ARRAY_MEMBERS[val].apply(obj, arguments);};
    }

    if (lib.isObject(obj) && OBJECT_MEMBERS.hasOwnProperty(val)) {
      return function() {return OBJECT_MEMBERS[val].apply(obj, arguments);};
    }

    return orig_memberLookup.apply(this, arguments);
  };

if i uncommented the obj = obj || {} line it breaks again in Windows 7 Firefox 49

@shaunpatterson
Copy link
Author

shaunpatterson commented Oct 6, 2016

https://github.com/shaunpatterson/nunjucks-recursion-error

Heres a reproducible case. It seems to be tied to the number of includes. See the readme on how to run.

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

2 participants