
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeI can see the issue! You're trying to nest an array inside another array, which causes this error in Sanity. The problem is that your textBlock is defined as type: "array", and you're trying to use it inside another array field.
The solution is to define textBlock as an object type, not an array type:
export default {
name: "textBlock",
title: "Text Block",
type: "object", // Changed from "array" to "object"
fields: [
{
name: "content",
title: "Content",
type: "array",
of: [{ type: "block" }],
}
]
};Now your main content array will work properly:
{
title: "Content",
name: "content",
type: "array",
group: "countryInfo",
of: [
{ type: "textBlock" }, // This now references an object, not an array
{ type: "image" },
{ type: "speedTest" },
{ type: "thePricingTable" },
],
}Why this works: In Sanity, when you have an array field, the items in the of array can be either:
block, image, stringBut you cannot directly nest arrays within arrays. By making textBlock an object type that contains an array field, you follow Sanity's schema structure correctly.
Alternative approach: If you just want rich text directly in your content array without the extra wrapper, you can simply use:
{
title: "Content",
name: "content",
type: "array",
of: [
{ type: "block" }, // Rich text directly
{ type: "image" },
{ type: "speedTest" },
{ type: "thePricingTable" },
],
}This gives you Portable Text rich text editing capabilities mixed with your custom block types, which is the standard pattern for Block Content in Sanity.
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.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store