Build with Sanity MCP in Replit. Prizes up for grabs! Submit by June 14

Array in Rich Text causing TypeError: (value || []).some is not a function

9 repliesLast updated: Nov 29, 2025

has anyone gotten this error when trying to add an array to rich text? It crashes the whole studio
TypeError: (value || []).some is not a function
    at ArrayInput.render (/static/js/app.bundle.js:334325:44)
    at finishClassComponent (/static/js/vendor.bundle.js:20318:31)
    at updateClassComponent (/static/js/vendor.bundle.js:20268:24)
    at beginWork (/static/js/vendor.bundle.js:21778:16)
    at HTMLUnknownElement.callCallback (/static/js/vendor.bundle.js:3346:14)
    at Object.invokeGuardedCallbackDev (/static/js/vendor.bundle.js:3395:16)
    at invokeGuardedCallback (/static/js/vendor.bundle.js:3450:31)
    at beginWork$1 (/static/js/vendor.bundle.js:26361:7)
    at performUnitOfWork (/static/js/vendor.bundle.js:25312:12)
    at workLoopSync (/static/js/vendor.bundle.js:25288:22)

AI Update

I've seen this error before! The TypeError: (value || []).some is not a function when adding an array to rich text (Portable Text) usually happens because of a schema configuration issue where your array field has corrupted data or an unexpected initial value.

Based on a community discussion about this exact error, here's what's likely happening and how to fix it:

Most Common Causes

1. Corrupted Document Data The error happens when the ArrayInput component tries to call .some() on a value that isn't actually an array. This typically occurs when you accidentally saved a document with an object {} instead of an array [] for your Portable Text field.

2. Schema Configuration Issue Sometimes an initialValue is set incorrectly:

// ❌ WRONG - will cause the error
{
  name: 'content',
  type: 'array',
  of: [{type: 'block'}],
  initialValue: {} // Object instead of array!
}

// ✅ CORRECT
{
  name: 'content',
  type: 'array',
  of: [{type: 'block'}],
  initialValue: [] // or just omit it
}

How to Fix It

Since you can't open the document in Studio to fix it, you'll need to edit it directly using the CLI:

Step 1: Get the document ID from the URL when you try to open it (even though it crashes). It'll look something like:

http://localhost:3333/desk/post;14f09fac-ddad-d4d4-9ed5-4b12346b3f90

Copy the ID part: 14f09fac-ddad-d4d4-9ed5-4b12346b3f90

Step 2: Open the document JSON in your terminal from your Studio directory:

sanity documents create --watch --replace --id 'YOUR_DOCUMENT_ID'

If you want to use VS Code as your editor:

VISUAL=code sanity documents create --watch --replace --id 'YOUR_DOCUMENT_ID'

Step 3: Look for the problematic array field in the JSON. It will likely look like:

"content": {}

Change it to:

"content": []

Step 4: Save and close the editor. The document will be updated automatically.

Important Note: If the document was published, you may also need to fix the draft version. The draft ID starts with drafts. - so if your document ID is abc123, you should also edit drafts.abc123 using the same command.

Prevention

After fixing the corrupted document, check your schema definition to ensure:

This should get your Studio back up and running! The CLI approach has helped others with this exact same error message.

Show original thread
9 replies

Was this answer helpful?

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Related contributions