+91 9962390267 | Sudtpatil@gmail.com

contexthub.kernel.js externalize undefined error

When you try to enable contexthub from head.html or from clientlibs.html you gets below error message in console throwing externalizer undefined.

extarnalize-of-undefined-contexthub-kernel-js

To Resolve this error we can do it in three ways.

1. Add granite utils before contexthub js call

We can add change below line of code as follows.

<sly data-sly-resource="${'contexthub' @ resourceType='granite/contexthub/components/contexthub'}"/>

Change it with below line of code.

<!--/* Include Context Hub */-->

<sly data-sly-use.clientLib="/libs/granite/sightly/templates/clientlib.html" data-sly-call="${clientlib.js @ categories='granite.utils'}"></sly>
<sly data-sly-resource="${'contexthub' @ resourceType='granite/contexthub/components/contexthub'}"/>

2. Embed granite utils library on aem project clientlibs

In this approach just embed below libraries on aem projects clientlibs.

  • granite.utils
  • granite.jquery
  • cq.jquery
  • cq.wcm.foundation
  • cq.wcm.foundation-main

3. Reinstall com.adobe.granite.contexthub.content

This should resolve your issue with context hub.

  • First go to crx/de then go to /etc/cloudsettings/default/contexthub.()
  • And delete the contexthub folder.
  • now go to crx/packmgr and search for com.adobe.granite.contexthub.content bundle.

When you get the bundle just hit reinstall this bundle.

This will resolve the contexthub contexthub.kernel.js. error.

And now if error resolved but segments are not getting resolved then check for cotexthub.seg.js is loading or not.

If not loading then add below script tag manual after contexthub call.

<script src=”/etc/segmentation/contexthub.seg.js”></script>

contexthub.kernel.js externalize undefined error
Scroll to top