Fixed version numbers lead to functional failures (one dark, language, autocompletion...)


  • node v16.18.1
  • npm v8.19.2
  • yarn v1.22.19

Create a Vite+Vue project

yarn create vue


<!-- App.vue -->
  <div ref="codeRef"></div>
<script setup>
import { EditorView } from "@codemirror/view";
import { onMounted, ref } from "vue";
import { oneDark } from "@codemirror/theme-one-dark";

const codeRef = ref(null);

onMounted(() => {
  new EditorView({
    parent: codeRef.value,
    extensions: [oneDark],

  1. when fixed version like this: yarn add @codemirror/view@6.9.1 @codemirror/state@6.2.0

    one dark doesn’t work

  2. remove and install by yarn add @codemirror/view @codemirror/state

    one dark working

  3. language,autocompletion… as same as one dark

The library doesn’t support loading multiple different instances of any of its modules, so make sure your tree is properly deduplicated. NPM is often dumb about this, especially when upgrading.