Uncaught TypeError: __webpack_require__(…).connect is not a function at connect (index.js:47532) at Object.connect (

試著忘記壹切 提交于 2019-12-12 15:09:17

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!