
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeThis is a classic preview configuration issue in Sanity! The error "Attribute name cannot be an empty string" with @[""] in your GROQ query happens when your schema has a preview select configuration that's trying to access a field with an empty string as the key name.
Looking at your XHR request, the generated query shows "w3": @[""], which means Sanity is trying to select a field with an empty name. This is almost always caused by a misconfigured preview.select in your schema definition.
Here's what's likely happening:
In your pageArchive document type (or one of the types it references), you probably have something like this in your preview configuration:
preview: {
select: {
title: 'title',
subtitle: 'slug.current',
'': 'someField', // ← This empty string key is the problem!
// or
media: '' // ← Or an empty string value
}
}How to fix it:
Find the problematic schema: Since you've narrowed it down to specific doc types, search your schema files for the pageArchive type and any types it references
Check the preview configuration: Look for any preview.select objects that have:
'': 'fieldName'fieldName: ''Common culprits based on the preview configuration documentation:
// BAD - empty key
preview: {
select: {
title: 'title',
'': 'description' // Remove this!
}
}
// BAD - empty value
preview: {
select: {
title: 'title',
media: '' // Should be a valid field path or removed
}
}
// GOOD
preview: {
select: {
title: 'title',
subtitle: 'description',
media: 'image'
}
}Check conditional logic: If you're using prepare functions with conditional logic, make sure you're not accidentally creating empty keys:
// This could cause issues if someCondition evaluates to empty string
select: {
[someCondition ? 'title' : '']: 'fieldName' // Don't do this!
}Quick debugging tip: Search your schema files for patterns like:
'': (empty string followed by colon): '' (colon followed by empty string)preview: { (then inspect each preview config)Once you remove or fix the empty string attribute name in your preview configuration, restart your Studio and the reference search should work properly. Since you're in a launch situation, this should be a quick fix once you locate the offending schema definition!
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