我最近开始编写React Native代码,并且在使用我的Async/Await函数和Async/Await箭头函数使Chrome调试器或React Native调试器正常工作时遇到了巨大的困难.
我可以成功地将调试器连接到我的代码并逐步完成我的大部分代码,但似乎当调试器进入我的异步方法时,它会失去对实际执行的行的跟踪,从而无法高效地工作.
即使console.log语句指示代码已执行,一些断点也不会受到影响.发生这种情况时,通常当前的调试行将切换到函数声明的行而不是实际执行的行.
我使用了我的应用程序crna,并在Windows 10中运行.不确定这是否相关.
我看到很多关于2016年各种论坛中类似行为的讨论,但最近没有关于它的新闻,所以我认为它已经修复了.如果没有,那么解决方法是什么?我需要一种方法来调试我的代码.
google-chrome-devtools reactjs react-native create-react-app react-native-debugger
我遇到了一个奇怪的问题。当我在调试模式下运行我的应用程序时,我的按钮中的 onPress 处理程序不会触发。当我停止在调试模式下运行应用程序时,按钮按预期工作。
调试在我的模拟器上工作,但在真实设备上失败。
细节:
OS: Mac
react: "16.11.0"
react-native: "0.62.2"
Run Code Online (Sandbox Code Playgroud)
代码
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow strict-local
*/
import React from 'react';
import {
Button,
SafeAreaView,
StyleSheet,
ScrollView,
View,
Text,
StatusBar,
} from 'react-native';
import {
Header,
LearnMoreLinks,
Colors,
DebugInstructions,
ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';
const App = () => {
return (
<>
<StatusBar barStyle="dark-content" />
<SafeAreaView>
<ScrollView
contentInsetAdjustmentBehavior="automatic"
style={styles.scrollView}>
<Header />
{global.HermesInternal == null ? null : (
<View style={styles.engine}> …Run Code Online (Sandbox Code Playgroud) 我是React-Native和Android应用程序开发的新手.当我尝试在Android Emulator(Pixel 2手机)中运行远程调试器时,我在模拟器中收到以下错误:
然后,即使我停止远程调试,应用程序也不会在模拟器上运行(即没有任何内容呈现在模拟器屏幕中).我需要再次运行该项目.
以下是自动生成的调试器URL:http://10.0.2.2:8081/debugb-
我该如何解决这个问题?
android remote-debugging react-native react-native-android react-native-debugger
通常,当我们点击该Debug JS Remotely选项时,会打开一个新选项卡google chrome(如下面的屏幕截图所示).
因此,如上面的屏幕截图所示,我们可以获得files我们正在处理的所有内容directory.
但在我的情况下,files不会出现chrome(如下面的截图)
可能是什么问题?
我正在阅读这篇关于分析 React 应用程序的文章:优化慢速 React 组件,在分析器中,您可以在工具提示和侧边栏中看到“为什么要渲染”:
在我的分析器中没有这样的信息。我正在使用最新版本的 React Native 调试器:
我怎样才能看到/显示这些信息?
I can't debug in react-native using the react-native debugger
Uncaught Error: Cannot add node "1" because a node with that id is already in the Store.
C:\Users\kbelhadjali\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:48 Uncaught Error: Cannot add node "1" because a node with that id is already in the Store.
at C:\Users\kbelhadjali\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:48
at c.emit (C:\Users\kbelhadjali\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:48)
at C:\Users\kbelhadjali\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:48
at C:\Users\kbelhadjali\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:48
at Array.forEach (<anonymous>)
at S.Gc.e.onmessage (C:\Users\kbelhadjali\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:48)
at S.n (C:\Users\kbelhadjali\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:40)
at S.emit (events.js:315)
at e.exports.P (C:\Users\kbelhadjali\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:8)
at e.exports.emit (events.js:315)
at e.exports.dataMessage (C:\Users\kbelhadjali\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:8)
at e.exports.getData (C:\Users\kbelhadjali\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:8)
at e.exports.startLoop (C:\Users\kbelhadjali\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:8) …Run Code Online (Sandbox Code Playgroud) 我们有一个本机反应项目,可以在模拟器和设备上正常运行。但是,我们无法使用iOS设备上的摇动手势打开开发人员菜单。
我看到了其他问题,但无法解决:https : //github.com/facebook/react-native/issues/5122
我们在Xcode中具有标准配置设置,因此可以使用调试方案进行构建。

但是,当摇晃设备时,我只是看起来很愚蠢,菜单没有显示。任何有关如何解决此问题的想法将不胜感激。
为了使用 React Native Debugger,当我使用 expo 在我的 android 模拟器和我的物理设备上打开开发人员菜单时,我没有看到“远程调试 JS”选项。尝试了两种方案,但没有远程调试 JS 的选项...
(我最初想将我的外部设备与 React Native Debugger 一起使用,但我在 node_modules/react-native/Libraries/Core/Devtools/setupDevtools.js 中找不到 setupDevtools.js 文件以更新此文件以供使用。我不知道这两个是否有关系,但也想分享)
我错过了什么吗?谢谢...
react-native react-native-android expo react-native-debugger
我使用react-native版本0.72.5和@react-native-firebase/app 18。
当我在Podfile中配置时,我添加use_frameworks! :linkage => :static并评论
# :hermes_enabled => flags[:hermes_enabled],
# :fabric_enabled => flags[:fabric_enabled],
# :flipper_configuration => flipper_config,
Run Code Online (Sandbox Code Playgroud)
我无法使用react-native-debugger,只能使用flipper,但网络不可用。如何调试呢?