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

280
Views
TypeError no capturado: existe no es una función

Tengo un volante para juegos de Logitech que me gustaría enviar señales a través de la web a otro compañero. Estoy usando PeerJS para establecer esta conexión. Cuando ejecuto el código en un entorno nodejs fuera de línea, puedo establecer una conexión con el volante y extraer señales.

Sin embargo, cuando intentaba mostrar las señales en la consola HTML, recibía un error que decía "el requisito no está definido". Para deshacerme del error "requerir no está definido", utilicé browserify para poder usar el módulo logitech-g29 en la web, pero me dio el nuevo error con "existe no es una función" en el archivo js creado por browserify .

¿Cómo puedo evitar este TypeError no detectado cuando intento establecer una conexión con el volante? Este error se llama en el archivo bundle.js que se crea desde browserify.

Código de línea de comando con browserify

 browserify -r logitech-g29 -o bundle.js

remitente.html

 <script src="https://unpkg.com/peerjs@1.3.1/dist/peerjs.min.js"></script> <script type="text/javascript" src="bundle.js"></script> <script type="text/javascript" src="main.js"></script>

principal.js

 (function () { const logitech = require('logitech-g29'); var lastPeerId = null; var peer = null; // own peer object var conn = null; var recvIdInput = document.getElementById("receiver-id"); var status = document.getElementById("status"); var message = document.getElementById("message"); var sendMessageBox = document.getElementById("sendMessageBox"); var sendButton = document.getElementById("sendButton"); var clearMsgsButton = document.getElementById("clearMsgsButton"); var connectButton = document.getElementById("connect-button"); function steeringWheel(){ const options = { autocenter: true, range: 270 } // This is where occurs below logitech.connect(options, function(err) { console.log('Ready') }) }
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!