Cannot read properties of undefined (reading 'parentNode')

Hello Make Community,

I’m facing an issue with my automation where the trigger is the Microsoft 365 “Watch Messages” module. The automation processes the content of an email, specifically the body:content field, using the Markdown module to format it.

The problem arises with a particular email. All other runs have completed successfully, but this specific email triggers an error in the Markdown module.

Has anyone else encountered similar issues with certain email formats or HTML structures? I’m wondering if there’s something in the email’s HTML content (like images, styles, or specific tags) that the Markdown module is unable to handle.

Any guidance or suggestions would be greatly appreciated!

Thank you in advance!

Hi @Momotaro
If you can share the html content from mail. we could further assist you.

Best regards,

Msquare Automation
Gold Partner of Make
@Msquare_Automation

<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none">
<!--
p {
    margin-top:0;
    margin-bottom:0;
}
-->
</style></head>
<body dir="ltr">
<div class="elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:11pt; color:rgb(0,0,0)"></div>
<div class="elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:11pt; color:rgb(0,0,0)">
    <br>
</div>
<div class="elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:11pt; color:rgb(0,0,0)">
    <br>
</div>
<div id="Signature">
    <p><span style="font-family:Arial,sans-serif; font-size:6pt"><img width="593" height="89" data-outlook-trace="F:1|T:1" src="cid:example-image-1" style="width:593px; height:89px; margin-top:0px; margin-bottom:0px"></span></p>
    <p><span style="font-family:Arial,sans-serif; font-size:6pt">This is an example email created for testing purposes. All the information contained here is fictitious and for demonstration only. No real content or data is used in this email.</span></p>
    <p><span style="font-family:Arial,sans-serif; font-size:6pt">Confidentiality Notice - This is a demo email created for testing HTML structures. There is no confidential information or attachments in this message. Please disregard if you have received this message by mistake.</span></p>
    <p>&nbsp;</p>
</div>
<div id="appendonsend"></div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr">
    <font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> John Doe &lt;john.doe@example.com&gt;<br><b>Sent:</b> Friday, September 6, 2024, 09:47<br><b>To:</b> Jane Smith &lt;jane.smith@example.com&gt;<br><b>Subject:</b> Re: Project Alpha : Deep tech insights</font>
    <div>&nbsp;</div>
</div>
<style type="text/css" style="display:none">
<!--
p {
    margin-top:0;
    margin-bottom:0;
}
-->
</style>
<div dir="ltr">
    <div class="x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:11pt; color:rgb(0,0,0)">Hi Jane,&nbsp;</div>
    <div class="x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:11pt; color:rgb(0,0,0)">
        <br>
    </div>
    <div class="x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:11pt; color:rgb(0,0,0)">Attached is the document you requested.&nbsp;</div>
    <div class="x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:11pt; color:rgb(0,0,0)">
        <br>
    </div>
    <div class="x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:11pt; color:rgb(0,0,0)">Thanks,</div>
    <div class="x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:11pt; color:rgb(0,0,0)">John.&nbsp;</div>
    <div class="x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:11pt; color:rgb(0,0,0)">
        <br>
    </div>
    <div id="x_Signature">
        <div style="font-family:Arial,Helvetica,sans-serif; font-size:10.6667px; color:rgb(0,0,0)"><span style="background-color:rgb(255,255,255)"><img id="x_image_0" width="476" height="72" data-outlook-trace="F:2|T:2" src="cid:example-image-2" style="width:476px; height:72px; margin:0px; vertical-align:top"></span></div>
        <div style="font-family:Arial,Helvetica,sans-serif; font-size:8pt; color:rgb(0,0,0)">Confidentiality Notice - This is a demo message for illustration purposes. No actual data is included.</div>
    </div>
    <div id="x_appendonsend"></div>
    <hr tabindex="-1" style="display:inline-block; width:98%">
    <div id="x_divRplyFwdMsg" dir="ltr">
        <font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Jane Smith &lt;jane.smith@example.com&gt;<br><b>Sent:</b> Thursday, September 5, 2024, 10:27<br><b>To:</b> John Doe &lt;john.doe@example.com&gt;<br><b>Subject:</b> Re: Project Alpha : Deep tech insights</font>
        <div>&nbsp;</div>
    </div>
    <style type="text/css" style="display:none">
    <!--
    p {
        margin-top:0;
        margin-bottom:0;
    }
    -->
    </style>
    <div dir="ltr">
        <div class="x_x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:11pt; color:rgb(0,0,0)">Can you send me the report please?</div>
        <div class="x_x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:11pt; color:rgb(0,0,0)">Thanks!</div>
        <div class="x_x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:11pt; color:rgb(0,0,0)">
            <br>
        </div>
        <div id="x_x_Signature">
            <p><span style="font-family:Arial,sans-serif; font-size:6pt"><img width="593" height="89" data-outlook-trace="F:3|T:3" src="cid:example-image-3" style="width:593px; height:89px; margin-top:0px; margin-bottom:0px"></span></p>
            <p><span style="font-family:Arial,sans-serif; font-size:6pt">This is an example of a fictitious confidentiality notice. No actual information is being transmitted here.</span></p>
        </div>
    </div>
    <br clear="all">
    <div><br></div>
</body></html>

This is a sample where i changed all personal info, but this is the structure of the html.
All other mails are similar to this one.