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

Vision tool is crashing, seemingly by fault of the codemirror package #5509

Open
piofinn opened this issue Jan 16, 2024 · 3 comments
Open

Vision tool is crashing, seemingly by fault of the codemirror package #5509

piofinn opened this issue Jan 16, 2024 · 3 comments

Comments

@piofinn
Copy link

piofinn commented Jan 16, 2024

Describe the bug

The vision tool crashes when opened, after a brief flash of the page layout. The error message (see screenshot below) points to multiple installed versions of @codemirror/state as a possible culprit.

To Reproduce

  1. Configure Sanity Studio with the visionTool plugin
  2. Open Sanity Studio and click on the "Vision" tab
  3. Observe the bug

Expected behavior

The vision tool should work as expected

Screenshots

Skjermbilde 2024-01-16 kl  15 56 39
(The two cut-off lines read "breaking instanceof checks")

Which versions of Sanity are you using?

@sanity/cli (global)          3.24.1 (up to date)
@sanity/eslint-config-studio   3.0.1 (up to date)
@sanity/icons                  2.8.0 (up to date)
@sanity/ui                     2.0.0 (up to date)
@sanity/vision                3.24.1 (up to date)
sanity                        3.24.1 (up to date)

What operating system are you using?

MacOS 13.6.1

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

node: 20.9.0
pnpm: 8.3.1
(npm: 10.1.0)

Additional context

Other installed tool plugins are sanity-plugin-media and sanity/structure, with both working as expected.

package.json:

{
  "name": "****",
  "private": true,
  "version": "1.0.0",
  "main": "package.json",
  "scripts": {
    "dev": "sanity dev",
    "start": "sanity start --host=0.0.0.0",
    "build": "sanity build",
    "deploy": "sanity deploy",
    "deploy-graphql": "sanity graphql deploy",
    "typecheck": "tsc"
  },
  "keywords": [
    "sanity"
  ],
  "dependencies": {
    "@sanity/icons": "^2.8.0",
    "@sanity/ui": "^2.0.0",
    "@sanity/vision": "^3.24.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-is": "^18.2.0",
    "sanity": "^3.24.1",
    "sanity-plugin-media": "^2.2.5",
    "styled-components": "^5.3.9"
  },
  "devDependencies": {
    "@sanity/eslint-config-studio": "^3.0.1",
    "@types/react": "^18.0.25",
    "@types/styled-components": "^5.1.26",
    "eslint": "^8.6.0",
    "prettier": "^3.2.2",
    "typescript": "^5.1.6"
  }
}
@deckchairlabs
Copy link

Yeah, this is also happening for me.

@pedrobonamin
Copy link
Contributor

pedrobonamin commented Jan 22, 2024

Hey @piofinn and @deckchairlabs could you please try removing your node_modules and pnpm.lock file and running a new install?

rm -rf node_modules pnpm-lock.yaml
pnpm i

You can find more info in this issue in codemirror

Please, let us know if that fixed the issue.

@deckchairlabs
Copy link

Hey @pedrobonamin, sorry for delay in getting back to, your solution above fixed the issue for me! Thanks

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

3 participants