Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

236
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!