Error during assembly of /apps | Community
Skip to main content
RashidJorvee
Level 4
June 22, 2024
Solved

Error during assembly of /apps

  • June 22, 2024
  • 4 replies
  • 1610 views

When I am deploying the code after adding a custom component, the front-end code is not loading on the site. When I try to rebuild the library Using AEM console, I am seeing these error "Error while reading cached library: javax.jcr.RepositoryException: Error during assembly of /etc/designs/br/scripts/all.js" also "java.io.IOException: Error while reading cached library: javax.jcr.RepositoryException: Error during assembly of /apps/brs/components/content/componentName/clientlib.js".

 

But when I am changing the JS processor from YUI to GCC it start working. And when I remove a function from a JS code file, YUI also work and front-end code script load on the code. Below is the JS function that causing issue.

 

function getPageUrlFromToken(data) {
        for(var pages of data.pageURL) {
            if(pages.rel === 'ADD.CARD') {
                console.log(pages);
                return pages.href;
            }
        }
    }

Any suggestion to fix this will be highly appreciated. Thank you!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by RashidJorvee

It start working after restarting the AEM instance without any change in code. 

Also, using "in" in-place of "of" in for loop, works.

4 replies

Level 2
June 23, 2024

If you need to use YUI, try simplifying your JavaScript code. The issue might be related to the for...of loop. You can replace it with a more traditional approach:

 

function getPageUrlFromToken(data) { for (var i = 0; i < data.pageURL.length; i++) { var pages = data.pageURL[i]; if (pages.rel === 'ADD.CARD') { console.log(pages); return pages.href; } } }

 

Check the full stack trace and logs for any additional clues. There might be more information on why the YUI compressor is failing with your specific code.

 

RashidJorvee
Level 4
June 25, 2024

Let me try with different way of for loop and test. Thank you for suggestion.

abhishekanand_
Community Advisor
Community Advisor
June 23, 2024

Hi @rashidjorvee 

 

getPageUrlFromToken(data) seems to be causing issues with the YUI processor. Try removing this function or commenting it out to see if the client libraries assemble correctly, If switching the JS processor from YUI to GCC resolves the issue, it might be a compatibility issue between your code and YUI. You can explore using GCC for your client libraries.

 

A corrupted clientlib cache can sometimes lead to assembly errors. Try clearing the clientlib cache and rebuilding the libraries.

Abhishek Anand
RashidJorvee
Level 4
June 25, 2024

After removing that function build is successful as I mentioned earlier.

 

I tried clearing the cache and rebuild the library from console, but still seeing the issue.

kautuk_sahni
Community Manager
Community Manager
June 25, 2024

@rashidjorvee Did you find the suggestion helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!  

Kautuk Sahni
RashidJorvee
RashidJorveeAuthorAccepted solution
Level 4
June 26, 2024

It start working after restarting the AEM instance without any change in code. 

Also, using "in" in-place of "of" in for loop, works.