title: Mixpanel conflicts with async/await functions
body: <p>Below is the sample html page with async/await function it works as expected but if we add Mixpanel default code async section fails.</p>
  <p><strong>Mixpanel default code</strong></p>
  <pre><code>&lt;!-- start Mixpanel --&gt;&lt;script type=&quot;text/javascript&quot;&gt;
  
  (function(c,a){if(!a.__SV){var b=window;try{var d,m,j,k=b.location,f=k.hash;d=function(a,b){return(m=a.match(RegExp(b+&quot;=([^&amp;]*)&quot;)))?m[1]:null};f&amp;&amp;d(f,&quot;state&quot;)&amp;&amp;(j=JSON.parse(decodeURIComponent(d(f,&quot;state&quot;))),&quot;mpeditor&quot;===j.action&amp;&amp;(b.sessionStorage.setItem(&quot;_mpcehash&quot;,f),history.replaceState(j.desiredHash||&quot;&quot;,c.title,k.pathname+k.search)))}catch(n){}var l,h;window.mixpanel=a;a._i=[];a.init=function(b,d,g){function c(b,i){var a=i.split(&quot;.&quot;);2==a.length&amp;&amp;(b=b[a[0]],i=a[1]);b[i]=function(){b.push([i].concat(Array.prototype.slice.call(arguments,
  0)))}}var e=a;&quot;undefined&quot;!==typeof g?e=a[g]=[]:g=&quot;mixpanel&quot;;e.people=e.people||[];e.toString=function(b){var a=&quot;mixpanel&quot;;&quot;mixpanel&quot;!==g&amp;&amp;(a+=&quot;.&quot;+g);b||(a+=&quot; (stub)&quot;);return a};e.people.toString=function(){return e.toString(1)+&quot;.people (stub)&quot;};l=&quot;disable time_event track track_pageview track_links track_forms track_with_groups add_group set_group remove_group register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user people.remove&quot;.split(&quot; &quot;);
  for(h=0;h&lt;l.length;h++)c(e,l[h]);var f=&quot;set set_once union unset remove delete&quot;.split(&quot; &quot;);e.get_group=function(){function a(c){b[c]=function(){call2_args=arguments;call2=[c].concat(Array.prototype.slice.call(call2_args,0));e.push([d,call2])}}for(var b={},d=[&quot;get_group&quot;].concat(Array.prototype.slice.call(arguments,0)),c=0;c&lt;f.length;c++)a(f[c]);return b};a._i.push([b,d,g])};a.__SV=1.2;b=c.createElement(&quot;script&quot;);b.type=&quot;text/javascript&quot;;b.async=!0;b.src=&quot;undefined&quot;!==typeof MIXPANEL_CUSTOM_LIB_URL?
  MIXPANEL_CUSTOM_LIB_URL:&quot;file:&quot;===c.location.protocol&amp;&amp;&quot;//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js&quot;.match(/^\/\//)?&quot;https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js&quot;:&quot;//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js&quot;;d=c.getElementsByTagName(&quot;script&quot;)[0];d.parentNode.insertBefore(b,d)}})(document,window.mixpanel||[]);
  mixpanel.init(&quot;MIXPANEL_ID&quot;, {loaded: function() {
         let distinct_id = mixpanel.get_distinct_id();
      }
  });
  
  &lt;/script&gt;&lt;!-- end Mixpanel --&gt;
  
  </code></pre>
  <p>*<strong>Sample Html code</strong></p>
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Test&lt;/title&gt;
  &lt;!-- End Google Tag Manager (noscript) --&gt;
  
  
  &lt;/head&gt;
  &lt;body&gt;
    &lt;strong&gt; Hope you are able to get 3 alerts. If no then please remove Mixpanel default code&lt;/strong&gt;
    &lt;script type=&quot;text/javascript&quot;&gt;
  
    window.onload = async function () {
  
        await  loadResponse(&quot; without await&quot;);
     }
     console.log(&quot;Start&quot;)
    async function loadResponse(msg) {
             console.log(&quot;Load Response&quot;+msg)
         }
      console.log(&quot; before await&quot;)
    &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  
  </code></pre>