0

I got error while converting docx to epub.

I have increased stack size but task is vain.

The error:

 RangeError: Maximum call stack size exceeded
at Array.filter (native)
at writeAll (D:\xxx\WorkingFolder\xxxx\public\node_modules\mammoth\lib\html-generator.js:73:15)
at Object.text (D:\xxxx\WorkingFolder\ACS_Live\public\node_modules\mammoth\lib\html-generator.js:12:13)
at DocumentConversion.elementConverters.text (D:\xxxx\WorkingFolder\x_x\public\node_modules\mammoth\lib\document-to-html.js:229:18)
at elementToHtml (D:\xxxx\WorkingFolder\xx_xx\public\node_modules\mammoth\lib\document-to-html.js:71:13)
at eval (D:\xxxx\WorkingFolder\xxxx\public\node_modules\mammoth\lib\document-to-html.js:64:20)
at iterate (D:\xxx\WorkingFolder\xxx_Live\public\node_modules\mammoth\node_modules\async\lib\async.js:134:13)
at Object.async.eachSeries (D:\xxx\WorkingFolder\xxx_Live\public\node_modules\mammoth\node_modules\async\lib\async.js:150:9)
at convertElements (D:\xxx\WorkingFolder\xxx_Live\public\node_modules\mammoth\lib\document-to-html.js:63:15)
at convertRun (D:\xxxx\WorkingFolder\xxx_Live\public\node_modules\mammoth\lib\document-to-html.js:122:9)
at elementToHtml (D:\xxx\WorkingFolder\xxx_Live\public\node_modules\mammoth\lib\document-to-html.js:71:13)
at eval (D:\xxxx\WorkingFolder\xxx_Live\public\node_modules\mammoth\lib\document-to-html.js:64:20)

Solution: Actually this is not node.js error but mammoth(see the above error log). While converting doc to epub, style is not converting. That is there was no proper valid document. I check and remove that pages. Now it is working fine.

Vanarajan
  • 973
  • 1
  • 10
  • 35

1 Answers1

0

Use
node --stack-size=val to change max stack size.

Sze-Hung Daniel Tsui
  • 2,282
  • 13
  • 20
  • This is a [duplicate](http://stackoverflow.com/questions/11332422/how-can-i-increase-the-maximum-call-stack-size-in-node-js), but I don't know how to mark duplicates. Do I not have enough permissions? Can anyone give me a tip in the comments? Thanks.. – Sze-Hung Daniel Tsui May 26 '15 at 13:32
  • 1
    Click "close" in the question and select the reason "duplicate of..." and add your linked question. – dan-lee May 26 '15 at 13:34
  • 1
    i am using windows. What is the value of "val"? It is not taking in application. – Vanarajan May 26 '15 at 13:40
  • 'Val' can be whatever number you like, but I expect your problem might have more to do with the code you are running than anything that could be fixed by manually increasing the stack size. What do you think? – Sze-Hung Daniel Tsui May 26 '15 at 13:43
  • Yes. But i donot know to the max size to handle large file(client can use any size) and i want to configure the size at global in my computer. This is very basic as i am new. – Vanarajan May 26 '15 at 13:48
  • thanks for your answer. This answer is not my solution. I am workaround the solution. At last i got it. The problem is that document is not proper ie 2 pages from 855 pages. Actually this is not node.js issue but in mammoth. Note: Need to create proper valid document. – Vanarajan May 28 '15 at 06:50