Basic example missing syntax-highlight

I just started from a basic example with the latest CodeMirror version, but it’s not syntax-highlighting JavaScript language code. Maybe I’m missing something here because I tried to downgrade all dependencies, but it didn’t fix them.

// "@codemirror/lang-javascript": "^6.1.4"
// "codemirror": "^6.0.1"

import { basicSetup, EditorView } from "codemirror";
import { javascript } from "@codemirror/lang-javascript";

new EditorView({
  doc: `function hello(who = "world") {
  console.log(\`Hello, \${who}!\`)
  extensions: [basicSetup, javascript()],
  parent: document.querySelector("#app")!,

I’m not seeing a way to get the output on that codesandbox page, but running this code seems to work fine on the sandbox.

I can confirm that it works locally, so it should have something wrong with CodeSandbox preview


If you downgrade @codemirror/lang-javascript to version 6.0.2 it works:

Might be something going on with codemirror using the older version of @codemirror/language.

You can see in your original yarn.lock there is a version of @codemirror/language being installed separate for @codemirror/lang-javascript.