Error while adding ContextHub to the page component | Community
Skip to main content
saumyaj49332255
Level 2
Sep 19, 2017 5:32 AM UTC
Solved

Error while adding ContextHub to the page component

down votefavorite

Hi,

We have used Context Hub Parameters on Adobe Target Framework within Adobe Target cloud configuration.

However, when we have add the following line to add ContextHub to our page component:

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

I am getting error on the console as shown below: enter image description here

I tried resolving this but the effort was in vain.

Can anyone help me regarding this ?

Do we need to add some dependency for ContextHub in our clientlibs?

Thanks !

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
saumyaj49332255
saumyaj49332255Accepted solution
Level 2
Sep 19, 2017 11:49 AM UTC

Got the problem solved.

We need to add embed property in our clientlibs with these values:

1. jquery

2. granite.utils

3. granite.jquery

4. cq.jquery

5. cq.wcm.foundation

6. cq.wcm.foundation-main

Thanks !

5 replies

narindera257447
Level 2
Jul 18, 2019 12:55 PM UTC

Follow the url Uncaught TypeError: Cannot read property 'externalize' of undefined · Issue #107 · adobe/aem-project-archetype · GitHub

and add the below in your header lib file

<!--/* Include Context Hub */-->
<sly data-sly-call="${clientlib.js @ categories='granite.utils'}"/>
<sly data-sly-resource="${'contexthub' @ resourceType='granite/contexthub/components/contexthub'}"/>

Translate
smacdonald2008
Level 10
Sep 19, 2017 3:43 PM UTC

Thank for you for posting. For those reading this thread and wanting to know how to get ContextHib into an AEM page -- see this artilce:

Scott's Digital Community: Using the ContextHub with the Experience Manager Toy Store site

Translate
saumyaj49332255
saumyaj49332255AuthorAccepted solution
Level 2
Sep 19, 2017 11:49 AM UTC

Got the problem solved.

We need to add embed property in our clientlibs with these values:

1. jquery

2. granite.utils

3. granite.jquery

4. cq.jquery

5. cq.wcm.foundation

6. cq.wcm.foundation-main

Thanks !

Translate
saumyaj49332255
Level 2
Sep 19, 2017 9:23 AM UTC

I tried with your solution, but it didnt work either.

Translate
kautuk_sahni
Employee
Sep 19, 2017 8:22 AM UTC

Can you increase the limit of org.apache.sling.engine.impl.SlingMainServlet (/system/console/configMgr under "Apache Sling Main Servlet) ->sling.max.calls=1000 to 2000/6000/15K+ (try all 3, 1 by 1). The intent of having this was to limit the number of nested/recursive calls.

Reference :-

1. https://mail-archives.apache.org/mod_mbox/sling-users/201202.mbox/%3C4A309956-28F4-4080-88A8-4B447C188BF7@adobe.com%3E

~kautuk

Translate
Kautuk Sahni