Sanity broken references crashing Next.js pages: find and fix them
Sanity broken references crashing Next.js pages? Find dangling refs with GROQ, harden your queries, and stop editors creating more. A rescue guide.
Tag
TypeScript patterns for Next.js and Sanity — typed schemas, GROQ result types, and end-to-end type safety.
37 posts
Sanity broken references crashing Next.js pages? Find dangling refs with GROQ, harden your queries, and stop editors creating more. A rescue guide.
Found a Sanity API token exposed in your Next.js bundle or repo? Here is how to confirm it, rotate it, and lock down your dataset and CORS settings.
Sanity page builder with 40 block types and editors afraid to touch it? Symptoms, what it costs to ignore, and the order I fix it in.
Content stuck in components? Here is how to add Sanity CMS to a Next.js site with hardcoded content one page at a time, without a full rebuild.
Sanity dataset full of orphaned images, stale drafts and dead documents? Here is how to find them, back up, and clean up safely without breaking live pages.
How to restructure a Sanity schema on a live Next.js site: audit, dual-read GROQ, scripted migrations and cleanup, without broken pages or lost content.
How to upgrade Next.js 15 to 16 on a Sanity-backed site: what changed, typical breakages, the cost of staying behind, and effort by codebase size.
Improve your Sanity Studio editor experience: fix flat schemas, missing previews, cluttered desks and weak validation so your marketing team uses it.
How to take over an existing Next.js project and Sanity codebase: first-week audit, access and ownership steps, red flags, and repair vs rebuild.
Still on Sanity Studio v2? What breaks in the v2 to v3 rewrite, why you should land straight on v6, and the real upgrade path by Studio size.
Thinking about hiring a JavaScript developer? Here's what full-stack JS actually means, why TypeScript matters, and what to ask before you commit. Read this first.
A practical process for building web apps for startups — discovery brief, thin-slice milestones, staging from day one, and a launch checklist.
A practical Next.js Tailwind workflow: design tokens as CSS variables, reusable component conventions, and a build sequence for shipping pages fast.
A production next.js typescript setup: strict tsconfig, typed routes, Zod boundaries, safe env vars, and a CI type-check gate that catches real bugs.
The React Next.js patterns I reuse on every project: server components by default, colocated data fetching, typed API boundaries, and error conventions.
Set up Next.js 16 with Tailwind CSS v4: the create-next-app flags that matter, and how the default setup compares with popular starter boilerplates over time.
Next.js route handlers and server actions work for many backend needs, but have real limits. Here's where they hold and where they break.
Choosing a Node.js CMS for a custom website? Honest trade-offs across Payload, Strapi, Directus, Keystone, and Sanity with a side-by-side comparison table.
Pages Router API routes vs App Router route handlers compared — caching, streaming, edge runtime, and a clear migration path with real code examples.
Tailwind CSS v4 rewired how teams configure, share, and ship styles. Here's what the CSS-first engine means in practice.
A step-by-step guide to exporting WordPress content, mapping schemas, running an import script, converting HTML to Portable Text, and preserving SEO with 301 redirects.
How to configure Sanity Agent Actions to trigger AI content workflows from the API — generate drafts, translate, and enrich fields at scale. Includes working code examples and real automation patterns.
Step-by-step setup of Sanity AI Assist (@sanity/assist) in a Next.js + Sanity project: install, config, field instructions, and real editor workflows. Updated for 2026.
Strapi vs Contentful 2026 — self-hosted open-source vs managed SaaS. Pricing, admin UX, API, Next.js fit, and lock-in compared honestly.
Learn how to write Sanity custom validation rules: required fields, regex, async checks, cross-field logic, and clear editor error messages.
Learn how to configure Sanity Structure Builder's defaultOrdering, documentTypeList grouping, and icons so a 20+ schema Studio still feels deliberate.
Payload CMS vs Contentful compared on schema control, API, pricing curve, and Next.js fit for 2026. Pick the right tool before you commit.
Payload vs Strapi: compared on self-hosting costs, TypeScript support, plugin ecosystem, and real migration complexity. Here's which one wins for most teams — and why.
Step-by-step guide to wiring Sanity CMS role-based access control with document-level permissions in a Next.js project. Covers custom roles, GROQ filters, and Studio UI.
How useFormStatus, useActionState, and use() from React 19 changed the way I build forms and async UI in Next.js App Router. Concrete before/after code.
Step-by-step guide to building a Sanity Studio custom input component using definePlugin, useFormValue, and PatchEvent with a real colour-picker example.
Deep dive into advanced GROQ queries in Sanity: inline joins, the coalesce() function, conditional projections, and array flattening with real payload sizes measured.
Kill CLS on Sanity images for good. Pull metadata.dimensions into next/image sizes and aspect-ratio boxes — exact GROQ and component code.
Learn how to build Sanity Portable Text custom components in Next.js — code blocks, callouts, embedded forms, and captioned images with full TypeScript types.
A step-by-step guide to Sanity TypeGen: CLI config, generating TypeScript types from GROQ queries, CI integration, and handling schema evolution gotchas.
A practical Next.js App Router tutorial guide for 2026. Covers layouts, route groups, Server Components, data fetching, static export, and the metadata API.
A step-by-step Sanity CMS + Next.js tutorial for developers setting up schemas, GROQ queries, and Sanity Studio with the App Router for the first time.