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

[v3] TypeError: undefined is not an object (evaluating 'elementProps.ref') #26

Open
ilyagru opened this issue Sep 26, 2022 · 0 comments

Comments

@ilyagru
Copy link

ilyagru commented Sep 26, 2022

Hi!

After updating sanity packages to dev-preview-20 the plugin broke. It was working on dev-preview-19. The default previews become empty and when trying to open to edit the code, the desk crashes. Please see the screenshots.

Versions

"@sanity/client": "^3.4.1",
"@sanity/code-input": "^3.0.0-v3-studio.9",
"@sanity/dashboard": "^3.0.0-v3-studio.3",
"@sanity/image-url": "^1.0.1",
"@sanity/vision": "^3.0.0-dev-preview.20",
"sanity": "^3.0.0-dev-preview.20"

Code schema

import dynamic from 'next/dynamic'

// @sanity/code-input dependencies
dynamic(() => import('ace-builds/src-noconflict/ace'), {
  ssr: false
})
dynamic(() => import('ace-builds/src-noconflict/mode-swift'), {
  ssr: false
})
dynamic(() => import('ace-builds/src-noconflict/mode-graphqlschema'), {
  ssr: false
})

const CodeBlock = {
  type: 'code',
  name: 'codeBlock',
  title: 'Code Block',
  options: {
    theme: 'tomorrow',
    darkTheme: 'monokai',
    withFilename: true,
    language: 'typescript',
    languageAlternatives: [
      { title: 'Batch file', value: 'batchfile' },
      { title: 'C#', value: 'csharp' },
      { title: 'CSS', value: 'css' },
      { title: 'Go', value: 'golang' },
      { title: 'GROQ', value: 'groq' },
      { title: 'HTML', value: 'html' },
      { title: 'Java', value: 'java' },
      { title: 'JavaScript', value: 'javascript' },
      { title: 'JSON', value: 'json' },
      { title: 'JSX', value: 'jsx' },
      { title: 'Markdown', value: 'markdown' },
      { title: 'MySQL', value: 'mysql' },
      { title: 'PHP', value: 'php' },
      { title: 'Plain text', value: 'text' },
      { title: 'Python', value: 'python' },
      { title: 'Ruby', value: 'ruby' },
      { title: 'SASS', value: 'sass' },
      { title: 'SCSS', value: 'scss' },
      { title: 'sh', value: 'sh' },
      { title: 'TSX', value: 'tsx' },
      { title: 'TypeScript', value: 'typescript' },
      { title: 'XML', value: 'xml' },
      { title: 'YAML', value: 'yaml' },
      { title: 'GraphQL', value: 'graphql', mode: 'graphqlschema' },
      { title: 'Swift', value: 'swift', mode: 'swift' }
    ]
  }
}

export default CodeBlock

Screenshots

Screenshot 2022-09-26 at 18 49 47

Screenshot 2022-09-26 at 18 48 59

Screenshot 2022-09-26 at 18 48 45

Screenshot 2022-09-26 at 18 50 00

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