An error has occured. Please check the browser console (F12)

Hello,

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.

Any suggestions?

Thanks,

Hello @WRSIT,

Could you please provide more information about the issue.

Do you get this error in one form only?

Do you have lookup fields or List or Library control on the form? Does it point to a large lists with many columns?

Hi,

We only get this error on one form.

We have 19 lookups and 1 library control on the form, some of the lists have around 190 columns.

Thank You,

Hello @WRSIT,

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.