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

150
Views
funciones drop(), dragOver(), dragLeave() en p5.js show Uncaught (en promesa) TypeError: No se pueden leer las propiedades de nulo (leyendo 'soltar')

Cuando intento crear algún evento dragOver, dragLeave o drop en p5 js, aparece el mismo error en la consola:

 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'drop') at setup (sketch.js:62:14) at _setup (p5.min.js:3:431165) at _start (p5.min.js:3:430064) at new _ (p5.min.js:3:433993) at p5.min.js:3:422096

Este es el extracto relevante del código de sketch js:

 var dropzone; function setup() { dropzone = select('#dropezone'); dropzone.dragOver(highlight); dropzone.dragLeave(unhighlight); dropzone.drop(unhighlight,gotfile); drop(highlight,unhighlight); } function highlight() { dropzone.style('background-color','#ccc'); } function unhighlight() { dropzone.style('background-color','#fff'); }

cualquiera de estos eventos de arrastrar o soltar muestra el mismo error

Este es el extracto relevante de html:

 <html> <head> <script src="lib/p5.min.js"></script> <script src="lib/p5.dom.js"></script> <script src="sketch.js"></script> <style> #dropezone { padding: 24px; border-style: dashed; font-size: 36pt; width: 50%; } </style> </head>

Intenté usar p5.js en lugar de p5.min.js, no ayuda. Uso Brackets sprint 14 build 1.14.2-17770 (release-1.14.2 f71f00acc) build timestamp: Tue Mar 31 2020 00:41:05 GMT-0700 y trabajo en MacOs Monterey 12.1 si esto importa. Tengo el proyecto en una carpeta local. ¿Que estoy haciendo mal? ¿Qué puede ayudar?

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!