narayanan reports that after upgrading to Discourse 2.8.0.beta7 & beta8, JavaScript placed in the </head> section of a theme component is intermittently failing to load in the browser, despite other sections like Header and After Header working correctly. They provided a screenshot showing the missing script file in the browser source. pfaffman suggests the issue may stem from recent changes related to Ember CLI, even if not explicitly enabled. david questions whether the issue is site-specific, noting the intermittent nature, and asks if any browser console errors are present. narayanan confirms console errors exist, sharing a screenshot indicating script blocking. david then advises checking for a proxy (e.g., Cloudflare) in front of the site and recommends temporarily disabling it to test if it resolves the issue. The thread seeks to determine whether the problem is a Discourse version regression or a configuration/environmental issue.
After upgraded to discourse 2.8.0.beta7 & beta8 versions, below issue was occurred,
I have written some javascript in theme component </head> (or) Head section which will work when discourse events getting triggered like OnAppEvent, DecorateWidget & OnPageChange. But the scripts written in </head> section wasn’t loaded in the browser sometimes. Header and After Header sections are loading well across the site. I found the </head> section script file was missing in browser source by seeing the below image,
Are you seeing any errors in the browser console? I’m surprised that the issue only happens ‘sometimes’ - that makes me think it might be something specific to your site’s setup, rather than something that changed in Discourse