Giter VIP home page Giter VIP logo

Comments (6)

KimPaow avatar KimPaow commented on August 20, 2024

Is your array with the name 'cover' a child of another array by any chance? Sanity does not support multidimensional arrays (for now) :)

from sanity-color-list.

j0hnm4r5 avatar j0hnm4r5 commented on August 20, 2024

Nope! It is a root object inside the fields array in a root document. Like this:

export default createSchema({
  name: `default`,
  types: schemaTypes.concat([
    {
      name: `question`,
      type: `document`,
      fields: [
        {
          name: `cover`,
          type: `array`,
          of: [
            {
              type: `colors`,
              options: {
                list: [
                  { title: `Red`, value: `#f16d70` },
                  { title: `Teal`, value: `#88c6db` },
                  { title: `Purple`, value: `#aca0cc` },
                ],
              },
            },
          ],
        },
      ],
    },
  ]),
});

from sanity-color-list.

j0hnm4r5 avatar j0hnm4r5 commented on August 20, 2024

This issue mentions this exact error: sanity-io/sanity#452

This may be a problem with Sanity itself not supporting nested arrays.

from sanity-color-list.

j0hnm4r5 avatar j0hnm4r5 commented on August 20, 2024

And this pull request mentioned wrapping the schema in an object: sanity-io/sanity#1614

At face value, that seems like it might work. Instead of the plugin returning an array, it could return an object that contains an array.

from sanity-color-list.

KimPaow avatar KimPaow commented on August 20, 2024

Hmm, i will have to get my test studio up and running to try this out properly. But I feel like the problem shouldnt be with the plugin but rather with something else, since the type of the colors object is a string - not an array.

Could you try wrapping the colors fields in an object and see if that solves it?
If that doesnt solve it this issue is most likely unrelated to this plugin.

from sanity-color-list.

KimPaow avatar KimPaow commented on August 20, 2024

Closing this because of inactiveness, let me know if this is still an issue.

from sanity-color-list.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.