lang-html is not highlighting

I read the documentation, I read the source code, and I am getting no syntax highlighting.
I am creating the editor like this:

EditorState.create({
          doc,
          extensions: [
            history(),
            keymap.of([...defaultKeymap, ...searchKeymap, ...historyKeymap]),
            defaultHighlightStyle,
            html(),
            lineNumbers(), gutter({ class: 'cm-mygutter' }),
            search({ top: true })
          ]
        })

What’s the totally obvious think I am missing?

Cancel that. I found the issue

I run into this issue as well, but didn’t found the solution. My setup is simpler:

EditorState.create({
  doc,
  extensions: [
    basicSetup
    html(),
  ]
})

Notice that html autocompletition works and with similar setup I am able to get JSON highlighting. What am I missing?

It may be that you have duplicated dependencies in your node_modules tree. Removing your package lock and reinstalling usually fixes that.

1 Like

That solved it. Thanks!