Custom Iparsys - org.apache.sling.scripting.sightly.SightlyException
Hello All,
We customized OOB iparsys component(/libs/wcm/foundation/components/iparsys) as per our business requirement. Copied the whole iparsys component from /libs to /apps folder, /apps/abc/components/content/site/custom-iparsys
We made our other custom changes to /libs/wcm/foundation/components/utils/ResourceUtils.js and /libs/wcm/foundation/components/utils/ParagraphSystem.js and placed them under /etc/designs/abc/xyz_clientlibs/js folder(not a clientlib).
And then modified, iparsys.js(/apps/abc/components/content/site/custom-iparsys/iparsys.js) and par.js(/apps/abc/components/content/site/custom-iparsys/par/par.js)
to use above custom JS files instead of original(/libs/wcm/foundation/components/utils/ResourceUtils.js and /libs/wcm/foundation/components/utils/ParagraphSystem.js) as shown below.
Iparsys.js:-
use(["/etc/designs/abc/xyz_clientlibs/js/ParagraphSystem.js"],function (ParagraphSystem) {
});
Par.js:-
use(["/etc/designs/abc/xyz_clientlibs/js/ResourceUtils.js","/etc/designs/abc/xyz_clientlibs/js/ParagraphSystem.js","/libs/sightly/js/3rd-party/q.js"], function (ResourceUtils,
ParagraphSystem, Q) {
});
The above customization is working as expected in AEM 6.0. But now we are migrating from AEM 6.0 to 6.3 and its breaking with below exception
03.04.2018 11:28:59.899 *ERROR* [127.0.0.1 [1522735139874] GET /content/asdf/test.html HTTP/1.1] com.day.cq.wcm.core.impl.WCMDeveloperModeFilter Error during include of SlingRequestPathInfo: path='/content/asdf/test/jcr:content/lhs', selectorString='null', extension='html', suffix='null' org.apache.sling.scripting.sightly.SightlyException: org.apache.sling.scripting.sightly.SightlyException: javax.script.ScriptException: Failure running script
/apps/abc/components/content/site/custom-iparsys/iparsys.js: Required script resource could not be located: /etc/designs/abc/xyz_clientlibs/js/ParagraphSystem.js. The caller is /apps/abc/components/content/site/custom-iparsys/iparsys.js
But if we copy the custom JS files(ResourceUtils.js and ParagraphSystem.js) to folder /libs/wcm/foundation/components/utils_custom and update the path accordingly in iparsys.js and par.js as shown below, its working.
Iparsys.js:-
use(["/libs/wcm/foundation/components/utils_custom/ParagraphSystem.js"], function (ParagraphSystem) {
});
Par.js:-
use(["/libs/wcm/foundation/components/utils_custom/ResourceUtils.js", "/libs/wcm/foundation/components/utils_custom/ParagraphSystem.js", "/libs/sightly/js/3rd-party/q.js"],function (ResourceUtils, ParagraphSystem, Q) {
});
Could you please let us know, why iparsys.js and par.js is not able to call/include the custom JS files if they are present under /etc/designs/abc/xyz_clientlibs/js ?
How to resolve this issue in AEM 6.3?
Thanks in Advance