# Beginner having trouble with syntax highlighting JSON

**URL:** https://discuss.codemirror.net/t/beginner-having-trouble-with-syntax-highlighting-json/4775
**Category:** v6
**Created:** [July 29, 2022, 3:50pm UTC](https://discuss.codemirror.net/t/beginner-having-trouble-with-syntax-highlighting-json/4775 "2022-07-29T15:50:38Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![duncanc](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/duncanc/32/2306_2.png) [@duncanc](https://discuss.codemirror.net/u/duncanc)
#### Post date: [July 29, 2022, 3:50pm UTC](https://discuss.codemirror.net/t/beginner-having-trouble-with-syntax-highlighting-json/4775/1 "2022-07-29T15:50:38Z")

</div>

Hi, I’m just starting out with CodeMirror 6, trying to get a simple demo working of syntax highlighting of a JSON document.

This is what I have for my main code file (TypeScript), running in an otherwise empty HTML document:

```auto
import { basicSetup } from "codemirror";
import { EditorState } from "@codemirror/state";
import { EditorView } from "@codemirror/view";
import { json } from "@codemirror/lang-json";

function main(): void {
  let startState = EditorState.create({
    doc: JSON.stringify({array: [1, 2, 3, 4, 5], object: {bool: true, str: 'one two three four five'}, nothing: null}, null, 2),
    extensions: [
      basicSetup,
      json(),
    ],
  });
  
  let view = new EditorView({
    state: startState,
    parent: document.body,
  });
}

window.addEventListener('DOMContentLoaded', main, {once:true});

```

From what I have read, it seemed like this should be enough to get syntax highlighting via `basicSetup`, but currently the document remains unstyled. When the caret is over a curly brace or square bracket it does highlight the corresponding partner, though.

There’s no error recorded in the dev console. Any clues where am I going wrong?

Thanks!

---

<div class="post-metadata">

### Author: ![duncanc](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/duncanc/32/2306_2.png) [@duncanc](https://discuss.codemirror.net/u/duncanc)
#### Post date: [August 1, 2022, 11:40am UTC](https://discuss.codemirror.net/t/beginner-having-trouble-with-syntax-highlighting-json/4775/2 "2022-08-01T11:40:41Z")

</div>

OK, looks like I had `@codemirror/language` at version 6.0.0 rather than the latest revision for some reason, which was apparently incompatible with some other component in such a way that the syntax highlighting was failing without error.
