Common Errors and Limitation in XM Cloud Development
Hello everyone, In this blog, I will try to list down all the posssible error or limitation that is encountered during development in XM Cloud. This blog will be continous blogpost which will be updated over the period of time.
This blog will be divided based on two sections. 1. Errors and 2.Limitation
Section 1: Errors : Many errors are question asked to Sitecore and they have replied back with answers.
1. Access to fetch at 'https://edge-platform.sitecorecloud.io/v1/forms/data/4b24e4eae68d49cf8eb1692452625d2e-use' from origin '****.vercel.app' has been blocked by CORS policy: Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response.Understand this error
Solution:
1. Added Vercel.json using below code for cors
headers": [
{
"source": "/(.*)",
"headers": [
{ "key": "Access-Control-Allow-Origin", "value": "*" }
]
},
{
"source": "/vercel_app_domain_name/(.*)",
"headers": [
{ "key": "Access-Control-Allow-Origin", "value": "*" }
]
}
2. Check SITECORE_EDGE_CONTEXT_ID is added on vercel
2. Create Vercel project and link to a site from XM Cloud Deploy App, got the error saying: "To install a vercel project in a team integration, your github repository must be in an organization account.
Solution: Have the same email registered with at both GitHub and Vercel account.(Your xm cloud could be anything)
3. Vercel deployment getting failed due to some error in Sitecore pages.
Solution: Check the vercel log and you will get what got breaked with proper explanation. Below is the example for your reference where datasource was not added to a component on page. Just correct the datasource on component or just make that page never publish and publish it.
4. Error in Preloading of Data. GraphQL query is too complex to execute.
Solution:Start increasing the maxComplexity by 1000. If you get new maxDepth error "Query is too nested to execute. Depth is." then Start increasing the maxDepth by 100. This can be achieved using a patch as shown below. This will be only applicable to CM and not to Edge. You need to break your graaphql query to achive the same.
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
<sitecore>
<api>
<GraphQL>
<defaults>
<security>
<publicService type="Sitecore.Services.GraphQL.Hosting.Security.GraphQLSecurity, Sitecore.Services.GraphQL">
<complexityConfiguration type="GraphQL.Validation.Complexity.ComplexityConfiguration, GraphQL">
<maxDepth>100</maxDepth>
<maxComplexity>10000</maxComplexity>
<fieldImpact>2</fieldImpact>
</complexityConfiguration>
</publicService>
</security>
</defaults>
</GraphQL>
</api>
</sitecore>
</configuration>
5. Editing hosts are unavailable : The error being observed by users is "Connection to your rendering host failed with the following error: The remote server returned an error: (503) Server Unavailable"
Solution: Check the image optimization is disabled in your next config file. Check the bug section as it is fixed from JSS 22.1.0 version.Reference
6. XM Cloud environment is very slow and fields are not editable in Pages Editor
Solution : If you have lot of website hosted in XM Cloud, then try to increase MaxAllowedMemorySize value to 4096 MB
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<scheduling>
<agent type="Sitecore.Tasks.MemoryLimitCachePurgeAgent, Sitecore.Kernel">
<MaxAllowedMemorySize>4096MB</MaxAllowedMemorySize>
</agent>
</scheduling>
</sitecore>
</configuration>
6. Invalid mount config for type bind : Invalid properties mode:rprivate
Solution: Verify your daemon.json file (specially check for extra spaces). Check your docker compose version. For myself, I have to lower down the docker compose version to 2.26.0. The below commmand will work if docker is install through Chocolatey
//Unistall Docker compose version
choco uninstall docker-compose -y
//Install specific version
choco install docker-compose --version=2.26.0 -y
Section 2: Limitation
1. Graphql does not compare Item ID comparison.
2. Databse restore is not possible to keep the content in sync as XM Cloud is SaaS product and we do not have control on it. To keep the synchronization, best way is using Sitecore CLI for Sitecore Content Serialization
3. Filter by __Updated in Edge query using GraphQL is not working. "The field '__Updated' is not supported. The list of available predefined fields: '_name', '_path', '_parent', '_templates', '_hasLayout' and '_language'."
Solution or Work Around : Consider updateddaterange field with possible values("today","yesterday","thisweek","thismonth","lastweek","lastmonth","thisyear","older"). This value automatically converted to actual date during execution of query. For __updated field use LT,LTE,GT,GTE operartors in query. Example: updatedaterange == thismonth
4. Complex fields like multilist, treelist is not supported in Pages Editor.
Thanks for reading!!.
You can check my other blogs too if interested. Blog Website
Comments
Post a Comment