为什么在Firefox上进行React热重装会自动打开调试器? [英] Why does React hot-reloading on Firefox automatically open the Debugger?

查看:108
本文介绍了为什么在Firefox上进行React热重装会自动打开调试器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  • 操作系统::MacOS Catalina 10.15.5
  • 浏览器:启用了React Developer Tools 4.8.0插件的Firefox 78.0.2
  • IDE::Visual Studio代码1.46.1
  • 框架:反应
  • OS: MacOS Catalina 10.15.5
  • Browser: Firefox 78.0.2 with React Developer Tools 4.8.0 add-on enabled
  • IDE: Visual Studio Code 1.46.1
  • Framework: React

这突然开始于今天.也许Firefox在我不知道的情况下在后台进行了更新,但是一分钟这从未发生过,现在它不会停止发生.

This all of a sudden started happening today. Maybe Firefox updated in the background without me knowing, but one minute this never happened, and now it won't stop happening.

问题::每当我保存要处理的本地文件时,该文件都会出现React错误(可能是缺少组件属性或语法不正确),Firefox会重新加载页面,但随后会将我定向到Debugger DevTools选项卡,然后暂停页面.然后,我必须导航回到Console DevTools选项卡,然后手动重新加载页面.非常令人沮丧.

Problem: Whenever I save a local file I am working on that has a React error (could be a missing component prop, or improper syntax), Firefox reloads the page but then directs me to the Debugger DevTools tab, and pauses the page. I then have to navigate back to the Console DevTools tab, and manually reload the page. It's very frustrating.

当浏览器重定向到调试器时,页面上会显示对话框"Pauseed on debugger statement".突出显示的调试器代码为:

When the browser re-directs to the Debugger, there is a dialogue on the page saying "Paused on debugger statement". The highlighted debugger code is:

// --- Welcome to debugging with React DevTools ---
// This debugger statement means that you've enabled the "break on warnings" feature.
// Use the browser's Call Stack panel to step out of this override function-
// to where the original warning or error was logged.
// eslint-disable-next-line no-debugger
debugger;t.apply(void 0,o)};n.__REACT_DEVTOOLS_ORIGINAL_METHOD__=t,// $FlowFixMe property error|warn is not writable.

停止此操作的唯一方法是禁用React Developer Tools插件.我不知道如何禁用警告时中断"特征.任何帮助将不胜感激.

The only way to stop this is to disable the React Developer Tools add-on. I don't know how to disabled the "break on warnings" feature. Any help would be deeply appreciated.

===

编辑:我查看了React Developer Tools Profiler选项卡,依次转到设置",调试",然后注意到"Break on warnings"已被取消选中.仍然不确定解决方案是什么.

I looked at the React Developer Tools Profiler tab, went to Settings, then Debugging, and noticed that the "Break on warnings" was already unchecked. Still unsure what the solution could be.

推荐答案

这是最新的React Dev Tools(4.8.0)中的错误:

It's a bug from the latest React Dev Tools (4.8.0): https://github.com/facebook/react/issues/19308

解决方法是将警告时中断"设置打开然后再关闭.他们已经削减了一个修复该问题的版本(4.8.1).

Workaround is to toggle the Break on Warnings setting on and then off. They've already cut a release (4.8.1) that fixes the problem.

这篇关于为什么在Firefox上进行React热重装会自动打开调试器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆