
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeYour code structure looks correct - you're following the same modular pattern used in the Hydrogen starter. However, the crash you're experiencing when editing home.js isn't documented as expected behavior, and this appears to be a potential bug worth investigating.
Your setup follows best practices:
Your approach of splitting structure files is valid according to the Structure Builder documentation. The pattern you're using - exporting functions that accept the Structure Builder (S) parameter and composing them together - is the correct way to organize structure code:
// desk/home.js
export const home = (S) =>
S.listItem()
.title('Home')
.icon(HouseLine)
.child(
S.editor()
.title('Home Page')
.schemaType('homePage')
.documentId('homePage')
)
// desk/index.js
import { home } from './home'
export const structure = (S) =>
S.list()
.title('Content')
.items([
home(S),
...S.documentTypeListItems().filter(hiddenDocTypes)
])This matches the recommended patterns from the Structure Builder guide.
Troubleshooting steps:
Since crashes on file changes aren't documented behavior, try these approaches:
Check your Studio version - Make sure you're on the latest Studio v3 release. Run npm list sanity to check your version, and consider updating if you're not on the latest.
Look for console errors - When the crash happens, check your browser console and terminal for specific error messages. These will be helpful when reporting the issue.
Verify your imports - Ensure there are no circular dependencies between your structure files and that all imports resolve correctly.
Test with minimal configuration - Temporarily simplify your home.js to rule out issues with the icon import or specific Structure Builder methods:
export const home = (S) =>
S.listItem()
.title('Home')
.child(S.documentTypeList('homePage'))Report this issue:
Since this behavior isn't documented and your code follows established patterns, I'd recommend reporting this:
Include details like your Studio version, Node version, and the exact error messages you're seeing. The Sanity team can then determine if this is a bug with hot module reloading when structure files are split across modules, or if there's a specific configuration issue causing the problem.
Your code organization is solid - the issue appears to be with how the development server handles these particular file updates, not with your structure implementation.
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