Example from website does not work

Hi all,

I was hoping I could get just the most basic example to work, like the one form the main web site:


First thing I would have expected is a composer package, but that does not exist. So I downloaded the entire master zipfile of version 5.63.3 to my local public folder /_/lib/codemirror/5.63.3/

Your example points to ./lib/codemirror.js - which does not exist, the correct path is ./src.

But it does not stop there. “CodeMirror” can’t be found because its first line says

import { CodeMirror } from “./edit/main.js”

Apparently, it can’t deal with its own file structure.

Also, we need to add type=“module” to the JS script tag.

Would you agree that a basic example should include all instructions to just make it work? Where are these instructions?

Same with this example:


Even the demo files that are delivered with the master are having the problem:


Many thanks

This sounds like you’re downloading the repository zip file from github. Use the release files from CodeMirror: Release History instead, which contain the build output.

Thank you for answering so fast but whereever I click, inclunding this CodeMirror: Release History it downloads the entire project folder of 1.5 MByte that expands into almost 7 Mbyte.

In which folder inside the git repository do I find the “build output” please? I am ready to install those files by hand.


Yes. That’s the distribution. If you’re for some reason unwilling to use it, you’re going to have a difficult time using this library.

It’s the source repository, it doesn’t have build output in it.

If you only need the output files, you can use/download them from CDN (non-minified versions are hidden by default).