?
avatar infograf768
infograf768
6 Feb 2021

Steps to reproduce the issue

Display the smart search module in frontend.
Load frontend

Uncaught TypeError: Awesomplete is not a constructor

finder.js:70:34

@Hackwar

avatar infograf768 infograf768 - open - 6 Feb 2021
avatar joomla-cms-bot joomla-cms-bot - change - 6 Feb 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 6 Feb 2021
avatar Fedik
Fedik - comment - 6 Feb 2021

hm, it because finder.js have an optional dependency from Awesomplete.js.

In theory, this:

/*
* This segment of code sets up the autocompleter.
*/
if ($this->params->get('show_autosuggest', 1))
{
$this->document->getWebAssetManager()->usePreset('awesomplete');
$this->document->addScriptOptions('finder-search', array('url' => Route::_('index.php?option=com_finder&task=suggestions.suggest&format=json&tmpl=component')));
}

need to be moved before this:

$this->document->getWebAssetManager()
->useStyle('com_finder.finder')
->useScript('com_finder.finder');

Unfortunately WebAsset cannot handle optional dependencies, currently.

avatar Fedik
Fedik - comment - 6 Feb 2021

please test #32333

avatar infograf768 infograf768 - close - 6 Feb 2021
avatar infograf768
infograf768 - comment - 6 Feb 2021

Closing as #32333 solves issue

avatar infograf768 infograf768 - change - 6 Feb 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-02-06 16:53:30
Closed_By infograf768

Add a Comment

Login with GitHub to post a comment