🔮 Sanity Create is here. Writing is reinvented. Try now, no developer setup
Back to changelog

RxJS and Vite upgrade and bugfixes

Installation and upgrading

To initiate a new Studio without installing the CLI globally:

npx create-sanity@latest

To upgrade a v3 Studio:

npm install sanity@latest


RxJS upgraded to v7

This is an internal change, but if you have RxJS as a dependency in your Studio project you should make sure to upgrade to v7 of RxJS in your package.json. Otherwise you may get build errors due to changes in the Observable interface between v6 and v7 (note: this is a type change only, and should not affect the runtime behavior of your studio).

If you get a build error saying something similar to:

TS2322: Type 'Observable<…>' is not assignable to type 'ObservableInput<any>'. Type 'Observable<…>' is not assignable to type 'Observable<any>'. The types of 'source.operator.call' are incompatible between these types. …

Then the solution is to upgrade the version of RxJS used in your project or library to 7.x. See the full list of breaking changes in RxJS 7

Vite upgraded to v4

This is an internal change, but theoretically there might be small changes to how assets are handled between v3 and v4. If you're using custom Vite plugins or you are loading CSS or other files, please make sure they still work after the upgrade.

Notable changes

  • Reintroduces some flags for sanity graphql deploy. Note that flags will apply to all configured GraphQL APIs.

🐛 Notable bugfixes

  • Fixes issue with useFormValue hook lagging one iteration behind
  • Fixes issue where the uploaded images menu was inaccessible
  • Fixes some incorrect typings in defineField() when using Rule.valueOfField() - thanks @fritz-c
  • Adds schema validation error when defining already defined field names for image and file types
  • Supports Node ESM (>=14)

Published January 11, 2023