Uncaught Error: Unrecognized extension value in extension set ([object Object]). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.

For my case, I’m using @uiw/react-codemirror@4.21.25. but facing same issue. I’m trying resolve this for two days. But can’t able to fix.

Dependencies tree:
└─ @uiw/react-codemirror@4.21.25
├─ @babel/runtime@7.24.1
│ └─ regenerator-runtime@0.14.1
├─ codemirror@6.65.7
├─ @codemirror/state@6.4.1
├─ @codemirror/theme-one-dark@6.1.2
│ ├─ @codemirror/view@6.26.0
│ │ ├─ style-mod@4.1.2
│ │ ├─ w3c-keyname@2.2.8
│ │ └─ @codemirror/state@6.4.1
│ ├─ @codemirror/state@6.4.1
│ ├─ @lezer/highlight@1.2.0
│ │ └─ @lezer/common@1.2.1
│ └─ @codemirror/language@6.10.1
├─ @uiw/codemirror-extensions-basic-setup@4.21.25
│ ├─ @codemirror/autocomplete@6.15.0
│ │ ├─ @codemirror/language@6.10.1
│ │ │ ├─ @codemirror/state@6.4.1
│ │ │ ├─ @codemirror/view@6.26.0
│ │ │ ├─ @lezer/common@1.2.1
│ │ │ ├─ @lezer/highlight@1.2.0
│ │ │ ├─ style-mod@4.1.2
│ │ │ └─ @lezer/lr@1.4.0
│ │ │ └─ @lezer/common@1.2.1
│ │ ├─ @codemirror/state@6.4.1
│ │ ├─ @codemirror/view@6.26.0
│ │ └─ @lezer/common@1.2.1
│ ├─ @codemirror/lint@6.5.0
│ │ ├─ @codemirror/state@6.4.1
│ │ ├─ crelt@1.0.6
│ │ └─ @codemirror/view@6.26.0
│ ├─ @codemirror/language@6.10.1
│ ├─ @codemirror/search@6.5.6
│ │ ├─ @codemirror/state@6.4.1
│ │ ├─ @codemirror/view@6.26.0
│ │ └─ crelt@1.0.6
│ ├─ @codemirror/commands@6.3.3
│ ├─ @codemirror/view@6.26.0
│ └─ @codemirror/state@6.4.1
└─ @codemirror/commands@6.3.3
├─ @codemirror/language@6.10.1
├─ @codemirror/state@6.4.1
├─ @lezer/common@1.2.1
└─ @codemirror/view@6.26.0

Code:
import React from ‘react’
import CodeMirror, { ViewUpdate } from ‘@uiw/react-codemirror’;
import { json } from ‘@codemirror/lang-json’;

const Editor = () => {
return (

)
}

export default Editor