
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeHey! Gatsby build issues with Sanity starters can definitely be frustrating. Based on what you're experiencing, there are a few common culprits to check:
1. Missing or Invalid Token for overlayDrafts
If you're seeing overlayDrafts is set to true, but no token is given, you need to add an API token to your gatsby-source-sanity configuration. Create a read token from the API tab in your Sanity project and add it to your gatsby-config.js:
{
resolve: 'gatsby-source-sanity',
options: {
projectId: 'your-project-id',
dataset: 'production',
token: 'your-read-token-here',
overlayDrafts: true,
watchMode: true
}
}2. GraphQL API Not Deployed
The ERROR #gatsby-source-sanity_drafts.10001 error means your GraphQL API hasn't been deployed yet. Run this from your Sanity Studio directory:
sanity graphql deploy3. Plugin Compatibility Issues
If you're getting window.URL.createObjectURL errors, this is typically caused by outdated plugins. The sanity-plugin-mapbox-input plugin has a known issue with newer versions of mapbox-gl. This plugin is no longer maintained, so you'll need to either:
mapbox-gl to a compatible version in your package.json4. Outdated Packages
The Sanity blog starter might be using older versions. Check your package versions:
npm ls gatsby-source-sanityThe latest gatsby-source-sanity version should be compatible with recent Gatsby versions. Consider updating:
npm update gatsby-source-sanitysanity graphql deploygatsby cleangatsby buildIf you're still having issues, sharing the specific error message would help diagnose further. The Sanity Discord community is also super helpful for real-time troubleshooting!
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