如何在 vs 代码中调试反应?错误断点已设置但尚未绑定

Zeu*_*eus 6 debugging reactjs visual-studio-code

我创建了 React 网站并使用 gulp 运行它。我想使用 VS 代码调试它,但是当我设置断点时收到警告。这可能是什么问题?我所有的代码都在 c:\psadmin\src 文件夹中。

未经验证的断点。断点设置但尚未绑定。

我的launch.json

"configurations": [
    {
        "type": "chrome",
        "request": "launch",
        "name": "Launch Chrome",
        "url": "http://localhost:9005",
        "webRoot": "${workspaceFolder}"
    }
]
Run Code Online (Sandbox Code Playgroud)

我的本地目录

在此处输入图片说明

Gar*_*rth 0

尽管我使用的是 Webpack,但我也遇到了类似的问题。您应该能够将 webRoot 设置为 gulp 配置使用的入口点。例如,我的 Webpack 配置入口点是,src/entry.js所以我的启动配置是:

{
  "version": "0.2.0",
  "configurations": [
      {
          "name": "Chrome",
          "type": "chrome",
          "request": "launch",
          "url": "http://localhost:8089/#/",
          "webRoot": "${workspaceFolder}/src/entry.js"
      }
  ]
}
Run Code Online (Sandbox Code Playgroud)