Hi David,
I did what you recommended and found that the problem got fixed when I disabled the Elements module. Then I went to the hooks I created and discovered that a mailchimp script for a popup form was causing the problem.
Here is the script in question:
<script type="text/javascript" src="//downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script><script type="text/javascript">require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us17.list-manage.com","uuid":"84e188f8434d0cu78467d77fc","lid":"198c7881a8"}) })</script>
For now I’ve removed the script from my page, thanks for your support.