logue / vue-codemirror6

⌨️ @codemirror 6 component for @vuejs. Vue2 & Vue3 both supported.
https://logue.dev/vue-codemirror6/
MIT License
123 stars 16 forks source link

[Bug] Unable to use extensions #3

Open abreumatheus opened 2 years ago

abreumatheus commented 2 years ago

Hi. First, thank you for your great work on this package.

I'm trying to use codemirror extensions but almos all of them results in the same error in the console:

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

I tried uninstalling the @codemirror/state or updating to its last version but none of that worked.

To reproduce just try to add the @codemirror/history extension to the bare bones example.

logue commented 2 years ago

Did you call @codemirror/basic-setup for the extension? In that case, it is not necessary because it is included.

Also, @codemirror/history seems to have been migrated to @codemirror/commands because the repository is locked. Please change to this and try.

abreumatheus commented 2 years ago

It's true, but even using just basic-setup, that has both history and its keymap, I can't undo anything :( OBS: I'm using the full example and version 0.3.5

logue commented 2 years ago

The search popup that appears with CTRL + F is working, so it's not immediately clear why only history doesn't work.

It may be interfering with some processing on the vue side, and it seems that it will take time to isolate the problem.

logue commented 2 years ago

It was solved in 0.3.6 and 0.1.6. From this version, load basic-setup with basic prop.

<code-mirror v-model="text" basic />
logue commented 2 years ago

In 0.6.0 or later, @codemirror/basic-setup is no longer needed. If it is included in the package of the project you are using, it may not work properly. Please remove the package.

liu-xinhui commented 2 weeks ago
image image

I have same problem with "vue-codemirror6": "^1.3.2"

liu-xinhui commented 2 weeks ago

image image I have same problem with "vue-codemirror6": "^1.3.2"

I saved. delete node_modules,pnpm-lock.yaml and reinstall ,its work