Thursday, 13 June 2019

Sitecore SXA :: CSS and Javascript Files are Ignored

Problem: CSS and Javascript Files were ignored while Bundled.


We encountered a weird issue; the Sitecore SXA builds sites started rendering wrong; while doing a further investigation we found only the top 100 CSS files are rendered on sites however we have more than 100 css files in our global theme.



Temporary Solution


As we know Sitecore SXA comes with large in build SXA Component and we have separate CSS files as per component specific.

As we were not using all the vanilla Sitecore SXA component we sorted the CSS for not used component, at last, doing this we were able to solve the problem as all needed CSS started rendering and all good.


Further investigation 

We were curious to know why this issue when checked with @Adam and came to know this is a limitation in Sitecore SXA which will be fixed in later Sitecore SXA version.

It is due to the limitation of the Sitecore query.

<!--  Query.MaxItems
            Specifies the max number of items in a query result set.
            If the number is 0, all items are returned. This may affect system performance if a
            large query result is returned.
            This also controls the number of items in Lookup, Multilist and Value lookup fields.
            Default value: 100
      -->
    <setting name="Query.MaxItems" value="100" />