while I'm trying to use a custom clientlib its throwing the error as Uncaught ReferenceError: _ is not defined I added dependency as lodash also.
can you please help me in this
Solved! Go to Solution.
Views
Replies
Total Likes
Yeah, I'm using AEM 6.5.3 I tried to add a colorpicker plugin for RTE please find the reference here
please check sample code here if you are using color picker
https://aemlab.blogspot.com/2019/07/aem-rte-custom-plugins-1.html
If you are using any script file and getting "Uncaught ReferenceError: x is not defined " which means 'x' is either a variable or a method which you are trying to use before declaring it using var keyword. This means that there is a non-existent variable referenced somewhere. This variable needs to be declared, or you need to make sure it is available in your current script or scope otherwise , it will endup throwing this 'x' is not defined error . This usually indicates that your library is not loaded and JavaScript does not recognize the 'x'.
To solve this error: Load your library at the beginning of all your scripts.
There can be multiple other reasons for this issue:
I fixed it by removing the underscore.js dependency altogether. Added equivalent functions that were used from underscore.js
Thanks @nibedita07 It worked
@dasiascott99 @Bhargav1817 We hope you found the AEM community valuable. We anticipate your return as either a learner or a contributor. The community benefits from SMEs like you. Please ask your AEM peers to join and contribute. Happy AEM learning!
This worked for me thank you
Views
Likes
Replies
Views
Likes
Replies