Change8

Migrating to Sanity v4.20.0

Version v4.20.0 introduces 2 breaking changes. This guide details how to update your code.

Released: 12/2/2025

2
Breaking Changes
3
Migration Steps
14
Affected Symbols

⚠️ Check Your Code

If you use any of these symbols, you need to read this guide:

viteCodeMirror@sanity/clientportabletext@sanity/ui@sanity/pkg-utils@lezer/highlight@sanity/runtime-cli@rollup/plugin-node-resolve@google-cloud/storage@vitejs/plugin-reactform-data@date-fns/tzDescriptorConverter

Breaking Changes

Issue #1

The codebase has been refactored to remove CommonJS (CJS) support. Ensure all dependencies and custom code are using ES Modules (ESM) syntax where applicable.

Issue #2

The removal of CJS syntax might require updating custom build configurations or tooling that explicitly relied on CJS module resolution.

Migration Steps

  1. 1
    Run `npm install sanity@latest` to upgrade to this version.
  2. 2
    Review your codebase for any reliance on CommonJS syntax, as CJS has been removed.
  3. 3
    Refer to the comprehensive guide on [Installing and Upgrading Sanity Studio](https://www.sanity.io/docs/upgrade) for detailed upgrade instructions.

Release Summary

Sanity Studio v4.20.0 introduces a new CLI command for schema bloat visualization and caches generated schema fields. This release also removes CommonJS support across the codebase.

Need More Details?

View the full release notes and all changes for Sanity v4.20.0.

View Full Changelog