[英]Uncaught ReferenceError: Buffer is not defined at varintEncode (util.js:33:1) - due do this my application is crashing
Our application is showing this error in the console.我们的应用程序在控制台中显示此错误。 Please help if anybody knows about it.如果有人知道,请提供帮助。
Error-错误-
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]
I succeed to solve the problem by following those steps:我按照以下步骤成功解决了这个问题:
Uninstall Webpack 5: npm uninstall webpack卸载 Webpack 5: npm 卸载 webpack
delete package-lock.json删除 package-lock.json
Go to package.json and change from "React-scripts": "5.0.0" to "React-scripts": "4.0.3", Go 到 package.json 并从“反应脚本”:“5.0.0”更改为“反应脚本”:“4.0”
install webpack 4: npm install webpack@4.44.2安装 webpack 4: npm 安装 webpack@4.44.2
npm install npm安装
npm run start npm 运行启动
I hope it helps, if yes don't hesitate to upvote;)我希望它有所帮助,如果是的话,请不要犹豫;)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.