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 ReferenceError: CQ is not defined

Avatar

Avatar
Boost 3
Level 2
maheraj
Level 2

Likes

3 likes

Total Posts

9 posts

Correct Reply

0 solutions
Top badges earned
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Boost 3
Level 2
maheraj
Level 2

Likes

3 likes

Total Posts

9 posts

Correct Reply

0 solutions
Top badges earned
Boost 3
Boost 1
Applaud 5
View profile
maheraj
Level 2

05-12-2017

Hi there,

I am upgraded from AEM 6.0 to  AEM 6.2. There was some changes required and I have done those. Everything was fine. Recently I have upgraded CFP8. After that I am getting Uncaught ReferenceError: CQ is not defined in browser console in every page. I am getting this error in both author and publish instance. Here is the QA publish server of my application: Cheap Rental Cars and Car Rental Deals Worldwide - Fox Rent A Car.

Can you please help me to resolve this issue?

Here is my current instance version:

Adobe Experience Manager, Version 6.2.0.SP1-CFP8

Here is the browser console error:

Uncaught ReferenceError: CQ is not defined

     at main.js:97

Replies

Avatar

Avatar
Give Back
Level 1
venc49793627
Level 1

Likes

2 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Boost 1
View profile

Avatar
Give Back
Level 1
venc49793627
Level 1

Likes

2 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Boost 1
View profile
venc49793627
Level 1

08-01-2018

Hi maheraj

i ran into same issue after installing CFP9 package on 6.2SP1 instance both author and  publish instances. have you found solution for issue. i am struck with issue.

Thanks,

Venkat

Avatar

Avatar
Boost 3
Level 2
maheraj
Level 2

Likes

3 likes

Total Posts

9 posts

Correct Reply

0 solutions
Top badges earned
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Boost 3
Level 2
maheraj
Level 2

Likes

3 likes

Total Posts

9 posts

Correct Reply

0 solutions
Top badges earned
Boost 3
Boost 1
Applaud 5
View profile
maheraj
Level 2

08-01-2018

Hi venc49793627,

No I have not found the solution. I have created one day care ticket. But Adobe was not able to find the reason as well. Any way I shall let you know if I can figure out this. Please let me know if you find anything as well. Thanks

Avatar

Avatar
Give Back
Level 1
venc49793627
Level 1

Likes

2 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Boost 1
View profile

Avatar
Give Back
Level 1
venc49793627
Level 1

Likes

2 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Boost 1
View profile
venc49793627
Level 1

11-01-2018

Hi maheraj

issue seems to be with new image component being added after CFP8 package. new clientlibs folder under /libs/wcm/foundation/components/images. to fix our issue, i commented image.js in js.txt file. now CQ error is gone. but i do noticed form submission not working on IOS 11 devices. trying to see what causing issue with IOS11.

let me know if this helps.

Avatar

Avatar
Give Back
Level 1
keithb41576569
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Give Back
View profile

Avatar
Give Back
Level 1
keithb41576569
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Give Back
View profile
keithb41576569
Level 1

08-03-2018

We have the same issue in our environment since installing CFP9.  I just created a daycare ticket also.

Avatar

Avatar
Give Back 5
Level 4
Bharath_valse
Level 4

Likes

34 likes

Total Posts

65 posts

Correct Reply

11 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 25
Give Back 10
Give Back
View profile

Avatar
Give Back 5
Level 4
Bharath_valse
Level 4

Likes

34 likes

Total Posts

65 posts

Correct Reply

11 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 25
Give Back 10
Give Back
View profile
Bharath_valse
Level 4

17-07-2018

To fix this, you can add cq.shared dependency on "/etc/clientlibs/foundation/main" and it will work fine

Avatar

Avatar
Applaud 5
Level 1
suhashankare
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Applaud 5
View profile

Avatar
Applaud 5
Level 1
suhashankare
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Applaud 5
View profile
suhashankare
Level 1

06-08-2018

This Solution worked on, 6.4 instance, however this issues was with dispatcher which is resolve now, but at the first shot adding dependencies 'CQ.Shared ' worked for me on 6.4 Instance

Avatar

Avatar
Validate 1
Level 1
rushikesavaredd
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Applaud 5
View profile

Avatar
Validate 1
Level 1
rushikesavaredd
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Applaud 5
View profile
rushikesavaredd
Level 1

27-12-2018

Can you please give your inputs on this issue. this is issue got when using below code as page component.I am getting below " "use" is not defined" error during the AEM upgrade from 6.2 to 6.4.

--> <div data-sly-use.data="company-linkpage.js" id="company-links"> This is the div using the  .js file 

Below is the Complete Error:

--------------------------------------

ReferenceError: "use" is not defined       

Cannot serve request to /content/project/en/content/Tools_and_Resources.html in /apps/project/company-linkpage.js

Exception: <eval>:3 ReferenceError: "use" is not defined  at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)  at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:319)  at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:291)  at jdk.nashorn.internal.objects.Global.__noSuchProperty__(Global.java:1441)  at jdk.nashorn.internal.scripts.Script$\^eval\_.:program(<eval>:3)  at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:637)  at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494)  at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)  at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:421)  at jdk.nashorn.api.scripting.NashornScriptEngine.access$300(NashornScriptEngine.java:73)  at jdk.nashorn.api.scripting.NashornScriptEngine$3.eval(NashornScriptEngine.java:514)  at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:386)    at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:184)    at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:4 91)  at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:552)  at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponen

----------------------------------------------------------------------------------------- --------

Below is the code for company-linkpage.js :

"use strict";

use(['/apps/project/components/structure/basepage/userProfile.js'], function (userProfile) {

    var ret = {

        image: null,

        favoriteUrl: currentPage.path + '.html',

        userCanEdit: false,

        userCanEditTeam: false,

        isAnonymous: userProfile.isAnonymous()

    },

        image = currentNode.hasNode('image') ? currentNode.getNode('image') : null;

    ret.isFavorite = userProfile.isFavorite(ret.favoriteUrl);

    if (image) {

        ret.image = image.hasProperty('fileReference') ? image.getProperty('fileReference') : null;

    }

    if (!ret.image) {

        try {

            var res = image.hasNode("file") ? image.getNode("file") : null;

            ret.image = res.getPath();

            ret.image = "background-image: url("+ ret.image + ");";

        } catch(err) {

            ret.image = "background-image: url(http://placehold.it/150x150?text=Placeholder);";

        }

    } else {

        ret.image = "background-image: url(" + ret.image + ");";

    }

    var roles = userProfile.getRoles().iterator();

    while (roles.hasNext()) {

        var role = roles.next();

        if (role.label.equalsIgnoreCase('Non-Sales Leaders')) {

            ret.userCanEdit = 'true';

        } else if (role.label.equalsIgnoreCase('Non-Sales Editor')) {

            ret.userCanEdit = 'true';

        } else if (role.label.equalsIgnoreCase('Team Leader')) {

            ret.userCanEditTeam = 'true';

        }

    }

    ret.isAnonymous = userProfile.isAnonymous();

    return ret;

});  

Avatar

Avatar
Level 1
bernardb36
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
bernardb36
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile
bernardb36
Level 1

15-01-2019

Hi suhashankare,

What was the issue you had with the dispatcher?

Thanks in advance!

Avatar

Avatar
Level 1
gauravm29742313
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
gauravm29742313
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
View profile
gauravm29742313
Level 1

06-02-2019

Hi Rushikesavareddy,

Did you get any solution to the mentioned issue "use is not defined" ?

Can this be corrected by adding any dependency as we resolved the "CQ is not defined" error by adding cq:widget as dependency?

Avatar

Avatar
Level 1
gauravm29742313
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
gauravm29742313
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
View profile
gauravm29742313
Level 1

30-05-2019

Hi,

I got the solution of the issue, just change the use js name and its reference, like in my case js name was caseStudy.js so I changed it to caseStudyJS.js and also its reference and it worked.