- 🇩🇪Germany sunlix Wesel
Hey there,
I just came back to this because I was thinking if this is outdated.
I applied all settings from the screenshot and now I can reproduce this error.
The error occurs by set the config "Move all external scripts to the top of the execution order".
If you disable this kind of forcing the script order no error occurs.Do you have some insights why do you have this setting enabled and by what parameter a script is considered as "external"?
I try to understand in what way we could manage the script to be "unbreakable" if there is some external forces involved. - 🇩🇪Germany sunlix Wesel
Okay got it. We extended the library definition of
etracker/etracker.js
if event tracking is enabled in the settings.
This adds theetracker.js
to our library. But it is affected by the "force moving external scripts" settings fromadvagg
.
The source of the problem is not the advagg setting but the more the interaction with all library definitions and the removal of the defer attribute, which is mandatory.The solution
We split the library definition of the vendor script and our default event tracking into two seperate one with dependency definition.
So we can guarantee to script order will be stable and the script will work withoutdefer
- 🇩🇪Germany Anybody Porta Westfalica
Thanks @sunlix. I'm a bit afraid of removing the
defer
, because it might degrade performance?
https://pagespeedchecklist.com/async-and-deferDon't have the time to think about it too much now, so just a warning so far.
- 🇩🇪Germany sunlix Wesel
@Anybody
I should not have a high impact. The default Drupal js library behavior is already "load the scripts and the end of the<body>
" So it is nearly atDOMContentLoaded
. In default Drupal installation with olivero I get in both cases a Lighthouse Performance of 100%.
In comparision with matomo, they load their event tracking withoutdefer
too. Automatically closed - issue fixed for 2 weeks with no activity.