简体   繁体   English

Uncaught ReferenceError: Buffer is not defined at varintEncode (util.js:33:1) - 由于这样做我的应用程序崩溃

[英]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:我按照以下步骤成功解决了这个问题:

  1. Uninstall Webpack 5: npm uninstall webpack卸载 Webpack 5: npm 卸载 webpack

  2. delete package-lock.json删除 package-lock.json

  3. 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”

  4. install webpack 4: npm install webpack@4.44.2安装 webpack 4: npm 安装 webpack@4.44.2

  5. npm install npm安装

  6. npm run start npm 运行启动

I hope it helps, if yes don't hesitate to upvote;)我希望它有所帮助,如果是的话,请不要犹豫;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Angular: utils/util.js -> Uncaught ReferenceError: process is not defined - Angular: utils/util.js -> Uncaught ReferenceError: process is not defined Base45 - 未捕获的 ReferenceError:未定义缓冲区(React JS) - Base45 - Uncaught ReferenceError: Buffer is not defined (React JS) application.js未在开发中加载(未定义的ReferenceError:未定义$) - application.js not loading in Development (Uncaught ReferenceError: $ is not defined) 未捕获的 ReferenceError:库未在 js 中定义 - Uncaught ReferenceError: Gallery is not defined in js JS -> Uncaught ReferenceError: Dolphins 未定义 - JS -> Uncaught ReferenceError: Dolphins is not defined 未捕获的ReferenceError:我的函数未定义 - Uncaught ReferenceError: my function is not defined 错误:未捕获(承诺):ReferenceError:未定义缓冲区 - Error: Uncaught (in promise): ReferenceError: Buffer is not defined 如何从 util.js 文件导入 getToken 函数而不会出错? - How do I import getToken function from util.js file without getting an error? 未捕获的 ReferenceError:firebase 未定义 vue js - Uncaught ReferenceError: firebase is not defined vue js 未捕获的ReferenceError:app.js中未定义require:3 - Uncaught ReferenceError: require is not defined at app.js:3
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM