Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

dependent js file is not being accessed in component

Avatar

Level 9

Hi All,

 

I have created component which has reference to jquery and third party corousel js's.I have created client lib node and created js.txt and updated these js information.

Below error seeing on browser console.

 Uncaught TypeError: undefined is not a functiontravelCorousel.html:19 (anonymous function)clientlibs.js:3143 jQuery.Callbacks.fireclientlibs.js:3255 jQuery.Callbacks.self.fireWithclientlibs.js:3467 jQuery.extend.readyclientlibs.js:3498 completed.

Can someone help me how to fix this issue and for you reference i have attached component structure screen-shot as well.

Thanks In Advance.

1 Accepted Solution

Avatar

Correct answer by
Level 9

i have resoleved this issue and i made below changes only.

(1) I have removed "dependecies" property for clientLib node.

(2) I have kept only categories property and value as "cq.jquery"

Thanks for showing interest and your time in troubleshooting this issue.

View solution in original post

7 Replies

Avatar

Employee

make sure you serve your css/js files from /etc/designs or /etc/clientlib.

the /apps folder is locked down on publish.

Avatar

Level 9

Thanks Feike for your quick response and as of now i am trying in author only but not getting desired results.

I will try as you suggested and i have question here is even if want to test it in author also do I need to maintain j's/css file in /etc/designs.

Thanks,

Kishore

Avatar

Employee

Ah ok. I though the issue was on publish.

Any errors/warnings in your error.log?

How does you js.txt look like?

Avatar

Level 9

I am not seeing any error in error.log.

This error i am seeing on browser console."Uncaught TypeError: undefined is not a function".

The text inside the js.txt is as below.

#base=.
jquery-1.11.2.js
jquery.infinitecarousel.js

Thanks,

Kishore

Avatar

Employee

can you remove the #base=. line?

Can you make a screenshot of your clientlibs-definition?

And the way how you include them into the page?

Avatar

Level 9

(1)  i have icluded "cq:includeClientLib" tag to get reference of client libs.

<cq:includeClientLib categories="jquerysamples" /> 

(2)I have tried by removing #base=. line but still getting same issue.

Thanks,

Kishore

Avatar

Correct answer by
Level 9

i have resoleved this issue and i made below changes only.

(1) I have removed "dependecies" property for clientLib node.

(2) I have kept only categories property and value as "cq.jquery"

Thanks for showing interest and your time in troubleshooting this issue.