We have identified an issue with XM Cloud pages where the editing environment (EE) and pages.io are not communicating correctly with the rendering host. Under normal circumstances, the rendering host retrieves data from XM Cloud pages to display the content and structure. However, in this specific case, the amount of data being transferred exceeds the 2MB limit imposed by the rendering host, resulting in an error.
The information below outlines the steps to take if you encounter this error within pages.io and the editing environment (EE).
Connection to your rendering host...failed: Indicates a failed connection between XM Cloud and the rendering host.
The remote server returned an error: (413) Body exceeded 2MB limit: This error specifically indicates that the JSON object is too large.
When the JSON object surpasses the maximum size allowed by the rendering host's body parser (typically 2MB), the "(413) Body Exceeded 2MB Limit" error occurs.
Solution:
To resolve this issue,
Break down content: Divide large content into smaller sections to reduce the JSON object size. Utilize GraphQL queries to minimize the JSON object.
Content review: Remove unnecessary tags and fields from the page content.
Technical Solution: To accommodate larger JSON objects, increase the body parser limit in the following Next.js files from 2MB to 5MB. Please follow below steps for resolution in your code repo:
Steps 1: Go to the below path for this file:
data[key].ts
Render.ts
In these 2 files Extend the limit for 2mb to 5mb and then check what happen for this error.
[Key].ts & Render.ts extend the limit for this both files.
By implementing these steps, you can effectively resolve the error, ensuring that both page.io and the editing environment (EE) function properly within XM Cloud.