We've recently started to get the following errors when opening a form:
The service worker navigation preload request was cancelled before 'preloadResponse' settled. If you intend to use 'preloadResponse', use waitUntil() or respondWith() to wait for the promise to settle.
Failed to load resource: the server responded with a status of 400 (Bad Request) - https://.sharepoint.com/ERP/_api/web/getList('/ERP/Lists/**')/RenderListDataAsStream
[SharePoint Forms] Error: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property. at spform.js:42 FormManager:LoadContext
Uncaught (in promise) Error: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.at spform.js:42
We've not done any changes to our forms, this has just started occurring out of the blue.
That is a know SharePoint issue caused by limitations of the Modern UI. Specifically by maxJsonLength property that gets or sets the maximum length that is accepted by the JavaScriptSerializer object for JavaScript Object Notation (JSON) strings. Please find more information here.
If you open the default form, most likely, you will get the same error.
If you are using SharePoint 2019, one of the possible solutions is to change the maxJsonLength property value.
Another option, also suitable for SharePoint Online, is to remove lookup fields from the form. Or to remove some content types from the source lists.