
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeI understand you're having trouble deploying the Sanity Next.js Landing Page template on Netlify! This is a common issue, and there are several typical problems that come up with this setup. Let me help you troubleshoot.
Based on the landing page template guide, here are the most common issues and solutions:
For Next.js on Netlify, you need to ensure your build settings are correct:
web if your Next.js app is in a subdirectory)npm run build (or cd web && npm run build if in a subdirectory).netlify. For older versions, it was .nextThe sanity-template-nextjs-landing-pages uses a monorepo structure with both the Studio and the web frontend:
/studio/webYou might need to set up two separate Netlify sites - one for the Studio and one for the frontend. When Netlify builds from the repository, it needs to know which part to deploy.
Make sure you've configured these environment variables in Netlify (under Site settings → Environment variables):
SANITY_PROJECT_ID - Your Sanity project IDSANITY_DATASET - Usually "production"SANITY_API_TOKEN - If you're using authenticated requests (for preview mode)NEXT_PUBLIC_SANITY_PROJECT_ID - For client-side accessNEXT_PUBLIC_SANITY_DATASET - For client-side accessFor modern Next.js versions (13.5+), Netlify requires the @netlify/plugin-nextjs plugin. This should be automatically detected, but if not, add a netlify.toml file to your project root:
[[plugins]] package = "@netlify/plugin-nextjs"
If you're deploying the web frontend from the root of a monorepo, your build settings should be:
webnpm install && npm run buildwebnpm install && npm run buildWithout knowing your exact error, here are the most common ones:
npm install runs in the correct directoryIf you're still having issues after trying these steps, it would be helpful to know:
Feel free to share those details and I can provide more targeted help!
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