Jer*_*j K 5 google-chrome-extension reactjs
我正在尝试让我的 React 扩展程序用于本地开发,但 Chrome 开发人员工具中缺少“组件”和“分析器”。这仅发生在本地开发中,任何其他生产代码都按预期在开发人员工具中显示两个选项卡。我想知道这是否可以以某种方式解决?我三次检查了标签是否在那种情况下被隐藏,他们没有。如前所述,这只发生在开发版本中。当我单击扩展程序时,我收到以下消息:
This page is using the development build of React.
Note that the development build is not suitable for production.
Make sure to use the production build before deployment.
Open the developer tools, and "Components" and "Profiler" tabs will appear to the right.
Run Code Online (Sandbox Code Playgroud)
根据这些信息,我应该显示选项卡。
当我转到生产应用程序并单击 React 扩展时,我可以看到以下显示:
This page is using the production build of React. ?
Open the developer tools, and "Components" and "Profiler" tabs will appear to the right.
Run Code Online (Sandbox Code Playgroud)
而且我也可以毫无问题地看到这两个选项卡。
知道为什么会发生这种情况吗?我搜索了解决方案,但没有遇到。我发现的唯一一件事是有人提到您需要设置环境变量REACT_APP_ENV。我试图.env在我定义的文件REACT_APP_ENV='dev'以及 REACT_APP_ENV='development' 中设置这个值。即使应用程序和浏览器重新启动,它也没有解决问题。
这也发生在我身上。看起来像是 Chromium 中的一个错误,但临时解决方案是:
看看这个: https: //github.com/facebook/react/issues/19002#issuecomment-637462179
| 归档时间: |
|
| 查看次数: |
1304 次 |
| 最近记录: |