-
-
Notifications
You must be signed in to change notification settings - Fork 376
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
Error: Unrecognized extension value in extension set ([object Object]). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks. #608
Comments
This usually happens when your build pipeline decides to mix two copies or different versions of |
Yes, looks like a number of copies -
|
Try adding |
Nope, that didn't appear to affect the result of |
Hmm I think at this point it's going past my area of expertise, one last suggestion might be to run something like |
I'm glad you helped Lishid.
Can you recommend anyone else who may see some more approaches here?
I'm eager to make some more progress.
|
Hold on,
|
(Often completely removing your package lock and node_modules and reinstalling also helps with this issue.) |
We fixed this in our application by adding a Yarn Resolution to force a single version of
{
"resolutions": {
"@codemirror/highlight": "0.19.7",
"@codemirror/lang-javascript": "0.19.7",
"@codemirror/state": "0.19.9",
"@codemirror/view": "0.19.47"
}
} |
This comment was marked as spam.
This comment was marked as spam.
fix error in parent package: Unrecognized extension value in extension set ([object Object]). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks. codemirror/dev#608
This same bug also happens if |
Adding the following to vite config seems to fix for me (using pnpm). optimizeDeps: {
exclude: ['@codemirror/state'],
}, |
Can confirm works for me too. |
tried all suggested solutions, still getting error intermittently. is there solid fix to this |
Problems still exist "@uiw/react-codemirror": "^4.21.13", |
still an issue with the adding optimizeDeps: {
exclude: ['@codemirror/state'],
}, adding {
// ...
"pnpm": {
"overrides": {
"@codemirror/state": "^6.4.0"
}
},
// ...
} to reproduce
open the devserver page, error in js console
what does pnpm install
with
with
with
so all possible solutionuse "loose instanceof checks" - someObject instance of SomeClass
+ someObject.constructor.name == SomeClass.name
|
Installing |
可以尝试在node_modules中@codemirror依赖中所有的包下面各自安装的node_modules全部删掉然后重启解决 |
As in a similar issue, uiwjs/react-codemirror#216
I am using Codemirror libraries directly.
I have a code playground,
I commented out the lines for various extensions I've tried running, because each time I use an extension, no mind which kind I use, I see this error.
Running with no extensions leaves me compiled and running happily.
I'm glad for any help you can lend, I need some extensions in my build.
The text was updated successfully, but these errors were encountered: