Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Uncaught TypeError - Handlebars.compile is not a function - AEM 6.5

Avatar

Avatar
Validate 1
Level 1
id-genz
Level 1

Likes

2 likes

Total Posts

1 post

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
id-genz
Level 1

Likes

2 likes

Total Posts

1 post

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
id-genz
Level 1

28-06-2019

We are using a custom color picker from Experiencing Adobe Experience Manager - Day CQ: AEM 65 - Touch UI RTE (Rich Text Editor) Dialog Colo... - the color picker works fine, but color-picker.js throws this Uncaught TypeError, and that causes an issue with other plugins which load after it. My understanding is that Handlebars is included OOTB in AEM, based on the docs - SCF Handlebars Helpers (although, the 6.5 version of this documentation appears incorrect - helpers.js has moved to /libs/clientlibs/social/commons/scf/helpers.js in 6.5) which makes me think that the issue is due to helpers.js moving. Is there a step that is missing somewhere that I need to make sure Handlebars is included and accessible by this JS file?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,356 likes

Total Posts

3,227 posts

Correct Reply

917 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,356 likes

Total Posts

3,227 posts

Correct Reply

917 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

28-06-2019

The error is because the plugin is loading twice with page and in a popover dialog, and in the popover dialog the Handlebar js is not being loaded that causing the issue, in case if you are using custom plugins then add below condition in plugin js to load plugins only once.

if (document.location.pathname.indexOf("/editor.html/") > -1)

        addDialogTemplate();

I've updated the color picker and created new custom style plugin and both are working fine in 6.3,6.4 and 6.5

Answers (4)

Answers (4)

Avatar

Avatar
Boost 5
Level 2
narayana_chirra
Level 2

Likes

20 likes

Total Posts

14 posts

Correct Reply

1 solution
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Applaud 5
View profile

Avatar
Boost 5
Level 2
narayana_chirra
Level 2

Likes

20 likes

Total Posts

14 posts

Correct Reply

1 solution
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Applaud 5
View profile
narayana_chirra
Level 2

19-01-2021

if (document.location.pathname.indexOf("/editor.html/") > -1) {

        addDialogTemplate();

}

 

yes, it is working for us, we are having a similar issue with RTE Image Picker Plugin.

Avatar

Avatar
Establish
Level 6
antoniom5495929
Level 6

Likes

91 likes

Total Posts

212 posts

Correct Reply

39 solutions
Top badges earned
Establish
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Establish
Level 6
antoniom5495929
Level 6

Likes

91 likes

Total Posts

212 posts

Correct Reply

39 solutions
Top badges earned
Establish
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile
antoniom5495929
Level 6

28-06-2019

Hi,

the handlebars library is deployed by default if you include the cq.authoring.dialog clientlib into your project (as you can see from the image).

Screen Shot 2019-06-28 at 18.35.01.png

Thanks,

Antonio

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,356 likes

Total Posts

3,227 posts

Correct Reply

917 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,356 likes

Total Posts

3,227 posts

Correct Reply

917 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

23-08-2019

I updated color picker plugin, works with AEM 6.3+

you can get it from below:

AEM - Touch UI - RTE HTML Element Selector, Custom Style Plugin & Color Picker Plugin

Avatar

Avatar
Give Back
Level 1
shivamurthym775
Level 1

Like

1 like

Total Posts

8 posts

Correct Reply

1 solution
Top badges earned
Give Back
Boost 1
Affirm 1
View profile

Avatar
Give Back
Level 1
shivamurthym775
Level 1

Like

1 like

Total Posts

8 posts

Correct Reply

1 solution
Top badges earned
Give Back
Boost 1
Affirm 1
View profile
shivamurthym775
Level 1

23-08-2019

Hi Arun,

I was not able to fix the same issue by adding the

if (document.location.pathname.indexOf("/editor.html/") > -1)

        addDialogTemplate();

Do we need to do something else?@