Microsoft.SharePoint.Client.InvalidClientQueryException
This message shows up in 4 different situations. Pick the one that matches yours:
- POST /fields rejects a subtype property like RichText unless the body names the subtype{ FieldTypeKind: 3, RichText: false } without @odata.type is read as SP.Field and fails with 400 – plain text columns in the same loop succeed, so the list ends up half-built; use CreateFieldAsXml or annotate the typeCause and fix →
- A REST write over 2 MB fails with "The request message is too big"SharePoint Online rejects any REST request whose body exceeds 2,097,152 bytes (after JSON escaping, in UTF-8). A multi-line text field in a list holds far more than that – the cap is the request, not the field – so measure body bytes and split large JSON into parts.Cause and fix →
- A conditional spread hides a phantom column until SharePoint returns 400...(cond ? {…} : {}) bypasses the excess-property check, so a field the list doesn't have reaches the POST and 400s; two scripted sweeps find the restCause and fix →
- pageContext.site.serverRequestPath is not the page URL — it can hand you a REST endpointIt is the last SERVER REQUEST path, so a modern list view can hand you …/RenderListDataAsStream; validate the shape before storing it as your app pageCause and fix →