我有一个 expo 项目,我们可以运行和构建它,它可以在 android 和 iOS 中正常工作。我想要的是使用我的 Visual Studio 代码调试所述项目。
我遵循了一些指南并尝试了以下操作:
我得到的结果是带有调试器控件的小窗口出现一秒钟然后消失,没有任何日志或证据表明它做了什么。我检查了 vscode 中的终端选项卡、输出选项卡和调试控制台选项卡
顺便说一句,当我启用“远程调试 JS”时,chrome 调试器会启动并完美运行。
我的 launch.json 是由 react native 工具扩展自动生成的。我还尝试将 "sourceMaps":true 添加到附加配置中,最终结果是一样的。这是我的代码:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug Android",
"cwd": …Run Code Online (Sandbox Code Playgroud) debugging react-native visual-studio-code expo react-native-tools
我试图找到如何调试react-native-web应用程序(特别是使用Expo和vscode)。
我既没有在网络上也没有在react-native-web自己的网站上找到指导。
React Native Tools附带的调试配置旨在在 Expo 应用程序中运行,但我的目的是使用浏览器来调试/测试 React-Native-Web 行为。
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug in Exponent",
"request": "launch",
"type": "reactnative",
"cwd": "${workspaceFolder}",
"platform": "exponent",
"expoHostType": "local"
}
]
}
Run Code Online (Sandbox Code Playgroud) react-native react-native-web expo react-native-debugger react-native-tools