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

284
Views
Uncaught TypeError: exists is not a function

I have a logitech gaming steering wheel that I would like to send signals over the web to another peer. I am using PeerJS to establish this connection. When I run the code in a nodejs environment offline I am able to establish a connection with the steering wheel and extract signals.

However, when I tried to display the signals on the HTML console I would get an error that would say "require is not defined". To get rid of the "require is not defined" error, I used browserify to be able to use the logitech-g29 module on the web but it gave me the new error with "exists is not a function" in the browserify created js file.

How can I avoid this Uncaught TypeError when I try to establish a connection with the steering wheel? This error is called in the bundle.js file that's created from browserify.

Command Line code with browserify

browserify -r logitech-g29 -o bundle.js

sender.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>

main.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!