我们的应用程序在控制台中显示此错误。如果有人知道此错误,请提供帮助。
错误-
Uncaught ReferenceError: Buffer is not defined
at varintEncode (util.js:33:1)
at ./node_modules/multicodec/src/varint-table.js (varint-table.js:11:1)
at options.factory (react refresh:6:1)
at __webpack_require__ (bootstrap:24:1)
at fn (hot module replacement:62:1)
at ./node_modules/multicodec/src/index.js (index.js:16:1)
at options.factory (react refresh:6:1)
at __webpack_require__ (bootstrap:24:1)
at fn (hot module replacement:62:1)
at ./node_modules/content-hash/src/index.js (index.js:19:1)[enter image description here][1]
1条答案
按热度按时间l0oc07j21#
我通过以下步骤成功地解决了这个问题:
1.卸载Webpack 5:npm卸载webpack
1.删除包-lock.json
1.转到package.json并从“React-scripts”进行更改:“5.0.0”到“React脚本”:“4.0.3”、
1.安装Webpack 4:npm安装webpack@4.44.2
我希望它能有所帮助,如果是的话,不要犹豫,投赞成票;)