Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

363
Vistas
Why is CodeMirror failing with the examples that are part of the downloaded zip file?

I am new to CodeMirror and having difficulty getting it to work -- I am specifically looking to get it to work with Groovy.

The following are the steps I have taken:

  1. Downloaded CodeMirror-master.zip
  2. Unzipped it.
  3. Attempted to open "CodeMirror-master/mode/groovy/index.html"

When I open that file, the Groovy code in that file is not formatted. That file references "lib/codemirror.js". The file structure in the zip file does not contain "codemirror.js" in the "lib" directory. However, it does contain "codemirror.js" in the "src" directory. So, I copied everything from the "src" directory to the "lib" directory and it still doesn't display the formatted code from the example. When I open the Chrome browser developer tools it shows 4 errors, but I am so new to this type of development that I don't know what to do. I don't understand why "CodeMirror is not defined" is being thrown -- I assumed that the example code from CodeMirror would work...

The errors I see are as follows:

  1. Uncaught SyntaxError: Cannot use import statement outside a module (codemirror.js)
  2. Uncaught ReferenceError: CodeMirror is not defined at matchbrackets.js:10:9 at matchbrackets.js:11:3
  3. Uncaught ReferenceError: CodeMirror is not defined at groovy.js:10:9 at groovy.js:11:3
  4. Uncaught ReferenceError: CodeMirror is not defined at index.html:76:20

What took me down the path of trying out the examples was that I was unable to get it running with my own code after trying to follow the instructions and I have been banging my head against this for too long.

Any help would be greatly appreciated.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

After banging my head against for too long, I have finally found the answer:

the zip file that is currently being distributed is faulty (ie files are not where they are supposed to be and other files are missing).

I had to use the instructions for downloading it via NPM (ie npm install codemirror), then copy that directory structure to my project.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda