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

227
Visualizações
Highlight.js "Could not find the language 'undefined', did you forget to load/include a language module?"

I am using highlight.js for Froala editor code blocks at React. But I'm getting en error. I used registerLanguage function but it didn't work.

Error in browser:

enter image description here

Here is my code :

import FroalaEditor from 'react-froala-wysiwyg';
import hljs from 'highlight.js';
import javascript from 'highlight.js/lib/languages/javascript';
import 'highlight.js/styles/androidstudio.css';

hljs.registerLanguage('javascript', javascript)


export default function Editor({ handleEditor, data }: EditorType) {
  return (
    <div className="unreset">
      <FroalaEditor
        tag="textarea"
        onModelChange={handleEditor}
        model={data}
        config={{
          placeholderText: '',
          events: {
            //editor event
            contentChanged: function () {
              //.fr-element is editor wrapper tag
              document
                .querySelectorAll('.fr-element pre')
                .forEach((el: any) => {
                  // WARN: Falling back to no-highlight mode for this block. 
                  hljs.highlightElement(el);
                });
            },
          },
        
        }}
      />
    </div>
  );
}

Why does not work? Thanks.

about 4 years ago · Juan Pablo Isaza
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