Codemirror does not connect

Today I stopped working Codemirror , the code was correct and worked. I attached a screenshot, can anyone tell me what the problem is?

<script src=""></script>
<script src=""></script>
<link rel="stylesheet" href="">
<textarea id="code" >

 var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
        lineNumbers: true,


var pos=editor.posFromIndex(3);


I don’t see that pen listed in Derk Jan Speelman’s pens. Most, if not all, of his public pens are from 2017 and use an older version of CodeMirror. This pen of Derk’s seems to do what you are looking for though. Version 6 has just been released and has some breaking changes but you can follow Marijn’s Announcement or his Migration Guide to get similar results with the new version.

Oh, and if you want to get started with CodeMirror v6 using CodePen, I have an example CodePen that uses CodeMirror 6 with syntax highlighting, line numbers, and bracket matching.

Just the very basics.

I hope this was helpful.

You are hot-linking scripts on the old website. Don’t load the library from my server, put a copy on your own server.