title: Uncaught TypeError: __webpack_require__(...).connect is not a function at connect (index.js:47532) at Object.connect (
body: <p>I am getting this error </p>
  
  <p><a href="https://i.stack.imgur.com/Txxr4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Txxr4.png" alt="Img"></a></p>
  
  <p>when I am trying to test  code on react project:</p>
  
  <pre><code>var amqp = require('amqplib/callback_api');
  
  
  export function start2 (conn) {
  
  console.log("hello")
  
  amqp.connect('amqp://localhost:8000', function (err, conn) {
  
      conn.createChannel(function(err, ch) {
          var q = 'frontend';
          var msg = 'Hello!';
  
          ch.assertQueue(q, {durable: false});
          // Note: on Node 6 Buffer.from(msg) should be used
          ch.sendToQueue(q, new Buffer(msg));
          console.log(" [x] Sent %s", msg);
      });
      setTimeout(function() { conn.close(); process.exit(0) }, 500);
  
  
  
  });
  
  }
  </code></pre>
  
  <p>any help please and thanks.</p>