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

582
Views
what is this javascript error? "Uncaught DOMException: CanvasRenderingContext2D.drawImage: Passed-in image is "broken"

I am making a space shooter-style game, and the code I have made so far was working 2 days ago but now I am getting this error:

Uncaught DOMException: CanvasRenderingContext2D.drawImage: Passed-in image is "broken"

here is some of the code. I define the image here:

const baddie = new Image();        
baddie.src = './space_shooter_baddie.jpg'; 

and I am getting an error on this line:

ctx.drawImage(baddie, 0, 0, 28, 28, badx[i],  bady[i], 28, 28);

could someone please tell me what this means? thank you.

note: I just tried with a different image and it worked. so it's probably not a code error.

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