surmon-china / vue-codemirror

@codemirror code editor component for @vuejs
https://github.surmon.me/vue-codemirror
MIT License
3.28k stars 382 forks source link

Unrecognized extension value in extension set ([object Object]) when working with vue-mirror #226

Open helxsz opened 4 months ago

helxsz commented 4 months ago

Describe the bug

chunk-P4Q3QBM3.js?v=13caf26d:16802 Uncaught (in promise) Error: Unrecognized extension value in extension set ([object Object]). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.

Reproduction

<script setup lang="ts">

import { Codemirror } from 'vue-codemirror';
import { javascript } from '@codemirror/lang-javascript';
const mymirror = ref();
const extensions = [javascript() ]; 
const selectedData = ref('');
const disabled = ref(false);

</script>

System Info

System:
    OS: macOS 11.7.10
    CPU: (4) x64 Intel(R) Core(TM) i7-4650U CPU @ 1.70GHz
    Memory: 82.81 MB / 8.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 20.11.1 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.4 - /usr/local/bin/npm
    pnpm: 8.6.7 - /usr/local/bin/pnpm
    bun: 1.0.20 - ~/.bun/bin/bun
  Browsers:
    Chrome: 120.0.6099.109
    Safari: 16.6.1
  npmPackages:
vue: ^3.2.47 => 3.4.21 
codemirror: ^6.0.1 => 6.0.1 
vue-codemirror: ^6.1.1 => 6.1.1

Used Package Manager

npm

Validations

Panda2Chan commented 1 week ago

A similar error, my error is

chunk-YJMCY73I.js?v=cd83157c:4605 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'extension')