Page Tree Plugin Works in Development but Fails in Production
I see you're encountering a production error with @q42/sanity-plugin-page-tree that doesn't occur in development. Without seeing the specific error message, it's difficult to provide an exact solution, but I can point you toward the most effective troubleshooting approach.
What You Need to Do First
Share the actual error message - The error message from your production logs or browser console is critical for diagnosing the issue. Production errors can range from:
- Missing dependencies
- Build configuration problems
- Environment variable issues
- Version incompatibilities
- API or deployment platform issues
Each requires a different solution, so knowing the specific error is essential.
General Production vs Development Differences
When plugins work in development but fail in production, it's typically because:
Dependencies aren't properly installed - Check that
@q42/sanity-plugin-page-treeis listed independencies(notdevDependencies) in yourpackage.jsonBuild process differs - Production builds are optimized differently than dev mode. Try rebuilding from scratch:
rm -rf node_modules rm -rf .sanity # or your build directory npm install npm run buildEnvironment configuration - Verify your production environment has the same Node.js version and environment variables as development
Caching issues - Your deployment platform may be using cached builds
Where to Get Help
Since this is a community plugin (not an official Sanity plugin), the best places to get support are:
- Q42's GitHub repository - Check the Issues tab for similar problems or open a new issue with your error message
- Sanity Community Slack - The community can help troubleshoot third-party plugins
- This forum - Post again with the specific error message for targeted help
Configuration Check
Verify your sanity.config.ts is correct:
import {defineConfig} from 'sanity'
import {pageTree} from '@q42/sanity-plugin-page-tree'
export default defineConfig({
// ... other config
plugins: [
pageTree({
// your configuration
})
]
})Please share your error message and I or others in the community can provide specific guidance. Production errors can have many different causes, and the error message will tell us exactly what's going wrong.
Show original thread2 replies
Sanity – Build the way you think, not the way your CMS thinks
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.