【问题标题】:React errors indicate the compiled location of the file and not the uncompiled location of the fileReact 错误指示文件的编译位置,而不是文件的未编译位置
【发布时间】:2022-02-02 17:59:39
【问题描述】:

有时我有错误,错误的路由显示在编译文件中,而不是简单的文件中。例如:

react-jsx-dev-runtime.development.js:117 警告:列表中的每个孩子都应该有一个唯一的“key”属性。

检查Container的渲染方法。 请参阅https://reactjs.org/link/warning-keys 了解更多信息。

at Test
(http://localhost:3000/static/js/bundle.js:4874:5)

而不是

 at Test
    (src/components/Edit.tsx).

有什么方法可以配置它,以便我可以看到确切的问题线和路由?

【问题讨论】:

    标签: javascript html reactjs compiler-errors key


    【解决方案1】:

    尝试更改 webpack 配置中的 devtool:

    开发工具:“廉价模块源地图”,

    【讨论】:

      猜你喜欢
      • 2016-07-11
      • 2017-08-02
      • 1970-01-01
      • 2010-10-14
      • 2012-08-10
      • 1970-01-01
      • 2016-11-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多