Error "WebAssetManager is locked, you came late" in Joomla

I’m using Joomla 4.4, and this code to load a module to display it in a plugin.

echo JHtml::_('content.prepare', '{loadmoduleid 16}');

error

But the website say error WebAssetManager is locked, you came late

If I use {loadmoduleid 16} in a Joomla article it still working fine. I don’t sure what’s wrong?

Please help.

Thanks

WebAssetManager is locked, you came late

PHP

// Disable conflicting plugins or components
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->update('#__extensions');
$query->set('enabled = 0');
$query->where('type IN ("plugin", "component")');
$query->where('element NOT IN ("my_module_plugin", "conflicting_plugin", "conflicting_component")');
$db->setQuery($query);
$db->execute();

PHP

// Adjust module position or use module order plugin
// ...

PHP

// Load module in a different context (e.g., article)
echo JHtml::_('content.prepare', '{loadmoduleid 16}', true);

PHP

// Minify CSS and JavaScript files
// ...

// Combine multiple files into a single file
// ...

// Use a CDN to deliver assets

PHP

// Review custom code for potential conflicts
// ...

PHP

// Update Joomla and extensions using Joomla's update manager
// ...

Additional Tips:

  • You can use Joomla’s debugging tools to help identify the specific component or plugin that is causing the conflict.
  • If you’re using a caching plugin, try disabling it temporarily to see if it’s causing the issue.
  • Consider using a profiler to measure the performance of your website and identify any bottlenecks that might be related to asset loading.

Remember to replace the placeholder values with the actual names of your conflicting plugins, components, or modules.