Unlock seamless workflows and faster delivery with our latest releases - Join the deep dive

Fixing slow typing in Sanity Studio by setting up NextJS and Sanity correctly

4 replies
Last updated: May 30, 2024
Does anyone know how to disable auto-saving in Sanity Studio?I am experiencing very slow typing, because the studio is auto-saving every time I input a character in an input field. I know this has been an issue for some users in the past. This person fixed it by upgrading to Sanity version 3.35.2, but I'm using

"sanity": "^3.43.0",
"next-sanity": "^9.3.7",
May 29, 2024, 12:30 PM
It can’t be disabled. Can you share the schema for one of the documents that’s giving you issues?
May 29, 2024, 6:35 PM
Sure. Here is an article content schema (rich text).I'm noticing now that I get build errors that I don't get if I copy all my schemas into a different project and build that, so I might have set the project up wrong all together.


`export const articleContent = defineType({
  title: "Article Content",
  name: "articleContent",
  type: "array",
  of: [
    defineArrayMember({
      title: "Block",
      type: "block",
      // Styles let you define what blocks can be marked up as. The default
      // set corresponds with HTML tags, but you can set any title or value
      // you want, and decide how you want to deal with it where you want to
      // use your content.
      styles: [
        { title: "Normal", value: "normal" },
        { title: "H1", value: "h1" },
        { title: "H2", value: "h2" },
        { title: "H3", value: "h3" },
        { title: "H4", value: "h4" },
        { title: "Quote", value: "blockquote" },
      ],
      lists: [{ title: "Bullet", value: "bullet" }],
      // Marks let you mark up inline text in the Portable Text Editor
      marks: {
        // Decorators usually describe a single property – e.g. a typographic
        // preference or highlighting
        decorators: [
          { title: "Strong", value: "strong" },
          { title: "Emphasis", value: "em" },
        ],
        // Annotations can be any object structure – e.g. a link or a footnote.
        annotations: [
          {
            title: "URL",
            name: "link",
            type: "object",
            fields: [
              {
                title: "URL",
                name: "href",
                type: "url",
              },
            ],
          },
        ],
      },
    }),
    // You can add additional types here. Note that you can't use
    // primitive types such as 'string' and 'number' in the same array
    // as a block type.
    defineArrayMember({
      type: "imageWithCaption",
    }),
    defineArrayMember({
      type: "testimonial",
    }),
    defineArrayMember({
      type: "customerCase",
    }),
  ],
});
May 30, 2024, 7:50 AM
I can now confirm, it was set up incorrectly. I don't know what I did, but setting up NextJS and Sanity Studio from scratch and copying over all my code fixed both this issue and my build errors
May 30, 2024, 10:20 AM
Glad it was an easy-ish fix!
May 30, 2024, 2:50 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?