问题
I am getting this error
when I am trying to test code on react project:
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);
});
}
any help please and thanks.
来源:https://stackoverflow.com/questions/45936495/uncaught-typeerror-webpack-require-connect-is-not-a-function-at-connec