如何在ReactJS中使用非缩小的开发环境

use*_*964 5 javascript reactjs

我在生产中使用 ReactJS 创建了一个 Web 应用程序。添加新功能后,出现以下错误Error: Minified React error #130; visit http://facebook.github.io/react/docs/error-decoder.html?invariant=130&args[]=undefined&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings

当我单击该链接时,这是总结的错误消息: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.

该功能在本地实例上有效,但当我部署到服务器上时,会弹出错误。

我并不是从头开始创建这个项目,而是我从别人那里接手的。在项目根目录中,有一个名为.env.development(在我的本地实例上)的文件,而服务器上的代码库有一个名为.env

我不确定这是否有任何意义,只是想给出所有细节。

为了创建生产版本,我使用了以下命令sudo npm run build

这是我的构建脚本package.json

  "scripts": {
    "start": "react-app-rewired start",
    "build": "react-app-rewired --max_old_space_size=8192 build",
    "test": "react-app-rewired test --env=jsdom",
    "eject": "react-scripts eject"
  }
Run Code Online (Sandbox Code Playgroud)

这是config-overrides.js

module.exports = function override(config, env) {
  if (env === 'production') {
    config.devtool = false;
  }
  return config;
};
Run Code Online (Sandbox Code Playgroud)

我想知道如何获取完整的错误,这将使错误更容易调试。