Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Studio crashes when name of the array starts with 'true' or 'false' #5673

Closed
federicovezzoli opened this issue Feb 5, 2024 · 2 comments
Closed
Assignees
Labels

Comments

@federicovezzoli
Copy link

federicovezzoli commented Feb 5, 2024

Description

Reported in Github issue #5673:

When in a document schema you define an array with a name that starts with 'true' or 'false' the studio crashes.
With the error:
Error: Expected attribute name following '.

Steps to reproduce

What did the customer/requester do to encounter the issue?

Inside a document define an array like so:

        title: 'Answers',
        name: 'trueorfalseField',
        type: 'array',
        of: [
            {type: 'string', name: 'title', title: 'title'},
        ],
    },

Steps to reproduce the behavior:

  1. Go to the "answers" array inside the document
  2. Click on "add item"
  3. See error

(Carolina note: my error was failed to parse JSON path while customer's was Expected attribute name following ' , though I simply copy/pasted the schema field definition)

Expected behavior

What should have happened, or what did they expect?

The ability to add an item to that array

Is there a workaround?

If yes, describe what is the workaround. If no, describe how it completely blocks the use of Sanity.

No

Any additional context

Please attach screenshots of the console, a screen recording of the studio itself, or anything else you think would be helpful.

Customer's error:

image.png

image.png

@cngonzalez
Copy link
Member

Thanks for reporting, Federico (and for the very complete report)!

We've been able to reproduce this internally (with a slightly different error message) and the bug is now in triage. We'll ping you in this thread when it's resolved.

Copy link
Contributor

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants