如何在Vue中使用Kafka-node修复错误?



有人在vue.js中使用kafka-node时遇到这个错误

Uncaught TypeError: Cannot read properties of undefined (reading 'prototype')
at Object.inherits (app.js:143477:46)
at ./node_modules/kafka-node/lib/wrapper/BrokerReadable.js (app.js:85751:6)
at __webpack_require__ (app.js:221491:42)
at ./node_modules/kafka-node/lib/wrapper/BrokerWrapper.js (app.js:85806:22)
at __webpack_require__ (app.js:221491:42)
at ./node_modules/kafka-node/lib/kafkaClient.js (app.js:81658:23)
at __webpack_require__ (app.js:221491:42)
at ./node_modules/kafka-node/lib/producerStream.js (app.js:83390:21)
at __webpack_require__ (app.js:221491:42)
at ./node_modules/kafka-node/kafka.js (app.js:77699:26)

Kafka是一个事件流的东西(通常连接到一个数据库,我猜)。
Node.js是后端运行时。

这两件事都与像VueJS这样的前端完全无关(特别是如果不使用像next这样的东西),所以你可能会错误地认为你可以将两者混合使用。

我们没有更多的上下文,但到目前为止,仅仅阅读标题就表明从一开始就完全不兼容。

最新更新