Developer guides

Add live content to your application

Moves VisualEditing, defineLive, and isCorsOriginError exports to subpaths

v11.0.0

This major version update introduces changes to how applications must import VisualEditing, defineLive, and isCorsOriginError.

Breaking changes

This release moves the VisualEditing, defineLive, and isCorsOriginError exports to subpaths. This is necessary to allow support for output: static builds.

These changes are required for all projects updating to next-sanity v11 or later, regardless if they use static output builds.

Update steps

Update to the latest version of next-sanity:

After installing next-sanity v11 or higher, update any imports for VisualEditing, defineLive, and isCorsOriginError to use the associated paths instead of the root as shown in the examples below.

VisualEditing

defineLive

Import defineLive from the next-sanity/live path.

isCorsOriginError

Import isCorsOriginError from the next-sanity/live path.