Open hanamura opened 8 years ago
Thanks for the report! I'll be honest - I think this may be complex to fix, and I don't personally have any intention to work on it. I would gladly review and accept a pull request that fixes it, however!
There is no such problem with actual version of nunjucks: https://github.com/hanamura/nunjucks-include-range-error/pull/1
But this problem is still exists. I'll try to make reproducible test case.
It may depend on an environment how many items matter, but using
include
many times in forloop causes a RangeError.Steps to reproduce
JavaScript code:
Templates:
Render template with 10,000 items:
Expect to proceed without errors, but actually RangeError is caused:
It is not caused with a few files. This works fine:
Workaround
Avoid using
include
and write templates inline.Template:
Render:
This is an example repository:
This is Travis CI URL that represent it: