
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeI understand you're experiencing a 404 error when trying to access the Sanity Studio at localhost:3000/studio in your Next.js 13 app. This is a common issue, and I can help you troubleshoot it.
With Next.js 13+ App Router, the file structure is critical. Your Studio route should be at:
app/studio/[[...index]]/page.tsx
Note the double brackets [[...index]] - this creates an optional catch-all route. The structure should be:
app/ directorystudio/ folder inside app[[...index]]/ folder inside studio (with double brackets)page.tsx file inside that folderYour app/studio/[[...index]]/page.tsx should look something like this:
'use client'
import { NextStudio } from 'next-sanity/studio'
import config from '../../../sanity.config'
export default function StudioPage() {
return <NextStudio config={config} />
}Make sure you have the 'use client' directive at the top since NextStudio needs to run on the client side.
Ensure your sanity.config.ts (or .js) file is in the root of your project and properly configured. The import path in your Studio page should correctly point to this config file.
Make sure you have next-sanity installed:
npm install next-sanityIf you're using TypeScript, check your terminal for any compilation errors that might be preventing the route from being built properly.
Sometimes Next.js caching can cause issues. Try:
rm -rf .next
npm run devIf you have a custom basePath in your next.config.js, you might need to adjust your Studio route accordingly, or ensure your sanity.config.ts has the correct basePath setting.
The most common problem is the file path - double-check that you have [[...index]] with double brackets, not single brackets [...index]. The double brackets make it an optional catch-all route, which is necessary for the Studio to handle both /studio and /studio/* paths correctly.
If you're still having issues after checking these points, please share:
page.tsx fileThis will help me provide more specific guidance!
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