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

246
Visualizações
Type error:annot read properties of null (reading 'width')

I have a problem with the read properties, I don't know why this is throwing an error, earlier it was working fine, please see this here is some code where it is showing an error

      const ClarifaiFace=data.outputs[0].data.regions[0].region_info.bounding_box;
      const image = document.getElementById("inputimage");
      const width = Number (image.width);
      const height= Number (image.height);
       console.log(width, height);
       return {
         leftCol:ClarifaiFace.left_Col * width,
         topRow:ClarifaiFace.top_Row * height,
         rightCol: width - (ClarifaiFace.right_Col * width),
         bottomRow: height-(ClarifaiFace.bottom_Row * height)
         

       }
   };

Error:

Type error:annot read properties of null (reading 'width')

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

It seems there is no such element with id inputimage. That's why image variable is null and therefore you are getting the error about reading property of null.

about 4 years ago · Juan Pablo Isaza Relatório

0

What worked for me when I got this error was changing "inputimage" to "inputImage" on getElementById in the 'image' variable. Hope this helps!

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