You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using this library within a lambda function to convert email contents to plain text, since Microsoft Graph API returns them in HTML format. In one execution it processes about 20-30 emails in parallel.
I am getting the following error:
ERROR Maximum call stack size exceeded RangeError: Maximum call stack size exceeded
at Array.flatMap (<anonymous>)
at /var/task/node_modules/@selderee/plugin-htmlparser2/lib/hp2-builder.cjs:13:38
at /var/task/node_modules/@selderee/plugin-htmlparser2/lib/hp2-builder.cjs:40:33
at /var/task/node_modules/@selderee/plugin-htmlparser2/lib/hp2-builder.cjs:13:51
at Array.flatMap (<anonymous>)
at Picker.f (/var/task/node_modules/@selderee/plugin-htmlparser2/lib/hp2-builder.cjs:13:38)
at Picker.pick1 (/var/task/node_modules/selderee/lib/selderee.cjs:426:30)
at recursiveWalk (/var/task/node_modules/html-to-text/lib/html-to-text.cjs:1241:46)
at f1 (/var/task/node_modules/html-to-text/lib/html-to-text.cjs:27:44)
at formatBlock$1 (/var/task/node_modules/html-to-text/lib/html-to-text.cjs:1324:3)
and this is the code:
exportconstconvertHtmlToText=(html: string): string=>{consttext=htmlToText(html,{wordwrap: null,// Disable word wrapping});returntext;}
The text was updated successfully, but these errors were encountered:
Usually happens on very badly formed HTML. Like when someone put an unescaped stack trace inside.
Error message tells me very little without the HTML that causes this.
We have some protection against large input, but cloud functions may have even stricter limitations.
You may need to adjust limits options to sensible values.
I am using this library within a lambda function to convert email contents to plain text, since Microsoft Graph API returns them in HTML format. In one execution it processes about 20-30 emails in parallel.
I am getting the following error:
and this is the code:
The text was updated successfully, but these errors were encountered: