Closed oleersoy closed 7 years ago
Did you try to move loop into JavaScript and pass result to Nunjucks via addGlobal
? Though, my guess that you will receive same error, which makes it unrelated to Nunjucks itself.
Actually after rereading the stacktrace I'm starting to think this is a cheerio issue:
RangeError: Maximum call stack size exceeded
at uniqueSplice (/home/ole/Junk/@superflycss/utilities-fonts/node_modules/cheerio/lib/api/manipulation.js:106:23)
at /home/ole/Junk/@superflycss/utilities-fonts/node_modules/cheerio/lib/api/manipulation.js:130:3
at initialize.<anonymous> (/home/ole/Junk/@superflycss/utilities-fonts/node_modules/cheerio/lib/api/manipulation.js:49:7)
at exports.domEach (/home/ole/Junk/@superflycss/utilities-fonts/node_modules/cheerio/lib/utils.js:52:24)
at initialize.append (/home/ole/Junk/@superflycss/utilities-fonts/node_modules/cheerio/lib/api/manipulation.js:39:12)
at Object.<anonymous> (/home/ole/Junk/@superflycss/utilities-fonts/node_modules/@superflycss/task-test/src/main/js/index.js:46:105)
at initialize.exports.each (/home/ole/Junk/@superflycss/utilities-fonts/node_modules/cheerio/lib/api/traversing.js:300:24)
at /home/ole/Junk/@superflycss/utilities-fonts/node_modules/@superflycss/task-test/src/main/js/index.js:41:32
at DestroyableTransform._transform (/home/ole/Junk/@superflycss/utilities-fonts/node_modules/gulp-cheerio/lib/index.js:18:9)
at DestroyableTransform.Transform._read (/home/ole/Junk/@superflycss/utilities-fonts/node_modules/gulp-cheerio/node_modules/readable-stream/lib/_stream_transform.js:184:10)
at DestroyableTransform.Transform._write (/home/ole/Junk/@superflycss/utilities-fonts/node_modules/gulp-cheerio/node_modules/readable-stream/lib/_stream_transform.js:172:12)
I'll just close this for now, as I'm pretty sure it's a cheerio issue.
OS: Ubuntu 17.04 Node: v8.1.3
I have a loop that structure that generates every single combination of google font font-weight, font-size, and font-family literals. In the form shown below this generates a
RangeError: Maximum call stack size exceeded
. I suspect it's running into the types of issues discussed here.To see this:
This is the loop structure: