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

149
Views
DOMException no detectada: no se pudo ejecutar 'drawImage' en 'CanvasRenderingContext2D': el HTMLImageElement proporcionado está en estado 'roto'

Estoy aprendiendo a reaccionar mediante la codificación, alguna idea de por qué recibo este error 'DOMException no detectada: no se pudo ejecutar 'drawImage' en 'CanvasRenderingContext2D': el HTMLImageElement proporcionado está en el estado 'roto'. He estado atascado con esto durante algunas horas.

Ese error se muestra en drawImage que está dentro de la declaración if

mi código:

 const updatePreviewUrl = () => { if (currentCam) { let curSnapshotUrl = state.snapshot?.snapshotUrl.split("?ts=")[0]; let newSnapshotUrl = `api/cam/${....}/` + `${curCam.ident}/snapsht`; if (curSnapshotUrl ....) { setState({ ... }); } } }; const updateCanvas = () => { updatePreviewUrl(); const canvas = CameraCanvas.current; const ctx = canvas.getContext("2d"); const img = CameraImage.current; ctx.rect(0, 0, canvas.width, canvas.height); ctx.fill(); if (currentCam) { ctx.drawImage(img, 0, 0); } }; useEffect(() => { updateCanvas(); const img = CameraImage.current; img.onload = updateCanvas; return () => { img.onload = null; }; });

about 4 years ago · Santiago Gelvez
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!