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

Array fields with types markdown and code crash #83

Open
corysimmons opened this issue Oct 12, 2023 · 1 comment
Open

Array fields with types markdown and code crash #83

corysimmons opened this issue Oct 12, 2023 · 1 comment

Comments

@corysimmons
Copy link

Describe the bug

When I create a field like so:

defineField({
  name: 'body',
  title: 'Body',
  type: 'array',
  of: [
    {type: 'markdown'},
    {type: 'code'},
  ],
})

...it crashes the Desk Tool with the following error:

Error: Cannot read properties of undefined (reading 'map')
TypeError: Cannot read properties of undefined (reading 'map')
    at http://localhost:3333/node_modules/.sanity/vite/deps/chunk-4JRRZWP7.js?v=7a0caf95:143514:79
    at mountMemo (http://localhost:3333/node_modules/.sanity/vite/deps/chunk-4JRRZWP7.js?v=7a0caf95:18386:27)
    at Object.useMemo (http://localhost:3333/node_modules/.sanity/vite/deps/chunk-4JRRZWP7.js?v=7a0caf95:18710:24)
    at useMemo (http://localhost:3333/node_modules/.sanity/vite/deps/chunk-D3K572XJ.js?v=7a0caf95:1094:29)
    at ListArrayInput (http://localhost:3333/node_modules/.sanity/vite/deps/chunk-4JRRZWP7.js?v=7a0caf95:143514:64)
    at renderWithHooks (http://localhost:3333/node_modules/.sanity/vite/deps/chunk-4JRRZWP7.js?v=7a0caf95:17740:26)
    at mountIndeterminateComponent (http://localhost:3333/node_modules/.sanity/vite/deps/chunk-4JRRZWP7.js?v=7a0caf95:20490:21)
    at beginWork (http://localhost:3333/node_modules/.sanity/vite/deps/chunk-4JRRZWP7.js?v=7a0caf95:21471:22)
    at beginWork$1 (http://localhost:3333/node_modules/.sanity/vite/deps/chunk-4JRRZWP7.js?v=7a0caf95:25318:22)
    at performUnitOfWork (http://localhost:3333/node_modules/.sanity/vite/deps/chunk-4JRRZWP7.js?v=7a0caf95:24763:20)

Screenshots
image

Which versions of Sanity are you using?

@sanity/cli (global)          3.18.0 (up to date)
@sanity/code-input             4.1.1 (up to date)
@sanity/eslint-config-studio   2.0.1 (latest: 3.0.1)
@sanity/vision                3.12.1 (latest: 3.18.0)
sanity                        3.12.1 (latest: 3.18.0)

What operating system are you using?

MacOS Ventura 13.5

Which versions of Node.js / npm are you running?

  • Node: v16.17.0
  • npm: 9.8.1 (but I'm using pnpm@8.9.0)

Run npm -v && node -v in the terminal and copy-paste the result here.

@corysimmons
Copy link
Author

This also fails with all my packages updated.

@sanity/cli (global)          3.18.0 (up to date)
@sanity/code-input             4.1.1 (up to date)
@sanity/eslint-config-studio   3.0.1 (up to date)
@sanity/vision                3.18.0 (up to date)
sanity                        3.18.0 (up to date)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant