Closed prudhomm closed 7 months ago
Can you run it with --debug
or do you have a link to your book (so that I can debug the issue locally) ?
After investigation this issue locally: It looks like this is happening during parsing by Nunjucks, the page is huge and contains a lot of {% math %}
block (replaced from $$...$$
).
I'm looking on implementing a fix in Nunjucks, but it might not be easy (Nunjuck's parser is syncchronous, the best solution will be to have an async parser with some setImmediate
to avoid exceeding the call stack in the event loop).
I've open an issue on Nunjucks: https://github.com/mozilla/nunjucks/issues/749
@SamyPesse I have split the file with lots of formulas and now it passes through however the math rendering is broken with mathjax #1286
I'm encountering the same issue, and I believe the cause is very similar (too many mathjax equations). As far as layout is concerned, it wouldn't make a lot of sense to break up my file into multiple files.
@SamyPesse I noticed there was a discussion in 2015 regarding a similar issue for the search plugin #1009 for which it was suggested that folks change the search's max index size. Is there anything analogous for documents that require large amounts of mathjax rendering?
The trouble-maker is chapter1.md of this book: https://www.gitbook.com/book/jeffcochran/the-nurbs-book-solutions-unofficial/details
Hi, I'm encountering the same issue with one file with multiple equations (https://msm.gitbook.io/msm/introduction-1/newman_model). When I run gitbook --debug serve
(CLI version: 2.3.2 GitBook version: 3.2.3, running in a Windows 10 machine) I get:
Template render error: (C:[...]Newman_model.md)
RangeError: Maximum call stack size exceeded
Template render error: (C:[...]Newman_model.md)
RangeError: Maximum call stack size exceeded
at Object.exports.prettifyError (C:[...]\.gitbook\versions\3.2.3\node_modules\nunjucks\src\lib.js:34:15)
at new_cls.render (C:[...].gitbook\versions\3.2.3\node_modules\nunjucks\src\environment.js:469:27)
at new_cls.renderString (C:[...]\.gitbook\versions\3.2.3\node_modules\nunjucks\src\environment.js:327:21)
at Promise.apply (C:[...]\.gitbook\versions\3.2.3\node_modules\q\q.js:1165:26)
at Promise.promise.promiseDispatch (C:[...]\.gitbook\versions\3.2.3\node_modules\q\q.js:788:41)
at C:[...]\.gitbook\versions\3.2.3\node_modules\q\q.js:1391:14
at runSingle (C:[...]\.gitbook\versions\3.2.3\node_modules\q\q.js:137:13)
at flush (C:[...]\.gitbook\versions\3.2.3\node_modules\q\q.js:125:13)
at process._tickCallback (internal/process/next_tick.js:61:11)
However, the files are rendered properly within Gitbook.io
Note that the file in quite is relatively complex with a lot of math and table but this was never an issue with gitbook < 3.