function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Lightning component error: SecureElement does not allow access to async throws

I'm trying to get Google Tag Manager working with a Lightning Community. This involves getting a script and iframe into the site as per

Script can't be put into the community head markup or branding css, so I created 2 Lightning components as follows:

Header component
<aura:component implements="forceCommunity:availableForAllPageTypes">
    <ltng:require scripts="{!$Resource.googletagmanager}"/>

Body component
<aura:component implements="forceCommunity:availableForAllPageTypes">
    <iframe src=""
    height="0" width="0" style="display:none;visibility:hidden"></iframe>

The header component gives me an error as follows:

Uncaught Error: SecureElement does not allow access to async throws at

It looks like Lightning Components doesn't like the async attribute in the GTM script? If so, can I somehow get them to be friends? I can remove async from the script but I don't know how this will affect GTM. Anyone needed to do this before?
Martin ProkopMartin Prokop
I have same issue
Biao TianBiao Tian
I have the same issue when integrating Piwik JS to a lightning component.