Plotly library interferes with MathJax

I noticed, when included the plotly library in my HTML header, MathJax stopped working. All my LaTeX formulas appeared in raw source form instead of formatted math formulas.

I managed to fix it by including Plotly first.

That is, it works in this order:

<!-- Load plotly.js into the DOM -->
<script src=''/>
<!-- load MathJax -->
<script async='async' id='MathJax-script' src='' type='text/javascript'/>

…but if Plotly is loaded after MathJax, MathJax stops working.

I have no idea why, but I’m glad I found a workaround. I hope this helps others.