- Issue created by @RFord
When loading pages that utilize the yext_search
module, an intermittent JavaScript error occurs in the console, which affects the functionality of the search feature. The error is as follows:
Uncaught ReferenceError: initAnswers is not defined at HTMLScriptElement.onload ((index):28:133)
This error suggests that the JavaScript function initAnswers
is being called before it is fully defined, likely due to the script loading asynchronously.
yext_search
module is enabled and the initAnswers
function is required.Change the JavaScript loading behavior in yext_search.module
to load the script synchronously instead of asynchronously. This can be done by setting the async
attribute to false
for the script that loads initAnswers
.
None. This change does not alter the user interface but affects the loading behavior of JavaScript resources.
None. There are no changes to the APIs; this is purely a front-end performance enhancement.
None. No data model changes are required for this fix.
Active
1.0
Code