Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

369
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda