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

@sanity/vision and @sanity/code-input are both using a different version of @codemirror/state #96

Open
ootes opened this issue Jan 30, 2024 · 3 comments

Comments

@ootes
Copy link

ootes commented Jan 30, 2024

Describe the bug

@sanity/vision and @sanity/code-input are both using a different version of @codemirror/state. This is causing Sanity vision / Santiy code input plugin to throw to following error:
Error: Unrecognized extension value in extension set ([object Object]). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.

To Reproduce

  • Install latest version of Sanity 3.26.1
  • Install the latest version of Sanity Vision 3.26.1
  • Install the latest version of code-input 4.1.2
  • Load a page with either the vision editor or the code-input field on it

Screenshots
image

image

Which versions of Sanity are you using?
@sanity/code-input 4.1.2 (up to date)
@sanity/vision 3.26.1 (up to date)
sanity 3.26.1 (up to date)

@tomaszter
Copy link

Same problem! For me, it has nothing to do with Vision. The error still appears even when I deactivate Vision.
sanity 3.30.0
@sanity/code-input 4.1.3

@mvellandi
Copy link

Same thing here:
sanity 3.30.1
@sanity/vision@3.30.1
@sanity/code-input 4.1.3

@dangreaves
Copy link

I don't think this has anything to do with vision.

The dependency tree for @sanity/code-input is installing two separate versions of @codemirror/state (6.4.0 and 6.4.1).

pnpm ls @codemirror/state --depth 10

dependencies:
@sanity/code-input 4.1.2
├─┬ @codemirror/autocomplete 6.12.0
│ ├─┬ @codemirror/language 6.10.1 peer
│ │ ├── @codemirror/state 6.4.0
│ │ └─┬ @codemirror/view 6.23.1
│ │   └── @codemirror/state 6.4.0
│ ├── @codemirror/state 6.4.1 peer
│ └─┬ @codemirror/view 6.24.1 peer
│   └── @codemirror/state 6.4.1
├─┬ @codemirror/commands 6.3.3
│ ├─┬ @codemirror/language 6.10.1
│ │ ├── @codemirror/state 6.4.0
│ │ └─┬ @codemirror/view 6.23.1
│ │   └── @codemirror/state 6.4.0
│ ├── @codemirror/state 6.4.0
│ └─┬ @codemirror/view 6.23.1
│   └── @codemirror/state 6.4.0
└─┬ @codemirror/lang-html 6.4.7
  └─┬ @codemirror/autocomplete 6.12.0
    └─┬ @codemirror/language 6.10.1 peer
      ├── @codemirror/state 6.4.0
      └─┬ @codemirror/view 6.23.1
        └── @codemirror/state 6.4.0

When I pin @codemirror/state to 6.4.1 using pnpm.overrides, the problem goes away.

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

4 participants