Getting errors with the vision and code input plugins #3810
-
I upgraded to v3 of Sanity Studio, and got everything working initially. However, after updating from preview-9 to 22 (including all dependencies), a few things started crashing bad. The Vision plugin now has a TypeScript error when I register it:
When I open the Vision tool in the browser, I get this stack trace:
which I think is a bit weird, since I can see the The same thing goes with the codeInput plugin. I get the same type error, and the same kind of stack trace whenever I render a code input – although this time a colorSchemeContext is missing.
These are my dependencies: "dependencies": {
"@sanity/code-input": "^3.0.0-v3-studio.11",
"@sanity/vision": "^3.0.0-dev-preview.22",
"@sanity/ui": "1.0.0-beta.31",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^4.4.0",
"react-is": "^18.2.0",
"sanity": "3.0.0-dev-preview.22",
"sanity-plugin-iframe-pane": "^2.0.0",
"styled-components": "^5.3.6"
},
"devDependencies": {
"@sanity/eslint-config-studio": "^2.0.0",
"eslint": "^8.6.0",
"prettier": "^2.7.1",
"typescript": "^4.0.0"
} And this is my config: import { codeInput } from "@sanity/code-input";
import { visionTool } from "@sanity/vision";
import { createConfig } from "sanity";
import { deskTool } from "sanity/desk";
import VyLogo from "./components/VyLogo";
import { schemaTypes } from "./schemas";
export default createConfig({
name: "default",
title: "My project",
projectId: "xxx",
dataset: "production",
plugins: [deskTool(), visionTool(), codeInput()],
schema: {
types: schemaTypes,
},
}); The code can be found here, if you want to have a look |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I was having this too. This thread helped. Apparently the I replaced "@sanity/vision": "^3.0.0-dev-preview.22" with |
Beta Was this translation helpful? Give feedback.
I was having this too. This thread helped.
Apparently the
^
in"@sanity/vision": "^3.0.0-dev-preview.22"
can sometimes pull in the wrong version from NPM.I replaced "@sanity/vision": "^3.0.0-dev-preview.22" with
"@sanity/vision": "3.0.0-dev-preview.22"
(no^
), nuked my lock file andnode_modules
and reinstalled the dependencies and it fixed it.