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

235
Visualizações
HTML Canvas 2D context "Uncaught DOMException" Firefox

I have a Javascript function:

function drawSheaf(word_sheaf) {
    pageOffset = (parseInt(word_sheaf.page_number, 10) - 1) * PAGE_OFFSET_MULTIPLIER;

    console.log(CTX);
    CTX.beginPath();
    CTX.fillStyle='black';
    CTX.fillText(word_sheaf.word, word_sheaf.x_small/SCALING_FACTOR, word_sheaf.y_big/SCALING_FACTOR + pageOffset);
}

Which is resulting in the following console output:

Page loaded main.js:25:13
CanvasRenderingContext2D { canvas: canvas#canvas, mozCurrentTransform: (6) […], mozCurrentTransformInverse: (6) […], mozTextStyle: "12px Arial", mozImageSmoothingEnabled: true, globalAlpha: 1, globalCompositeOperation: "source-over", strokeStyle: "#000000", fillStyle: "#000000", filter: "none" }
editor.js:93:13
Uncaught DOMException: An exception was thrown editor.js:94
Uncaught DOMException: An exception was thrown editor.js:13
Use of mozImageSmoothingEnabled is deprecated. Please use the unprefixed imageSmoothingEnabled property instead. localhost:8004

Line 94 is CTX.beginPath()

Line 13 is in another function. In that case CTX.rect is the offending call.

How do you debug an error like this? The only hint here is the deprecation warning. But that's (a) a warning not an error and (b) not part of the DOMException. Expanding the DOMException only shows the code path to arrive there. I don't see an exception name or code.

enter image description here

The function runs fine on Chrome and draws the word as expected.

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