【问题标题】:Create react app and debug in VS Code in wsl ubuntu在 wsl ubuntu 的 VS Code 中创建 React 应用并进行调试
【发布时间】:2020-01-20 23:08:33
【问题描述】:

我正在尝试使用 VS Code 调试我在 WSL 中运行的 CRA 应用程序并运行到一个非常奇怪的结果。 如果我在 VS Code 中设置断点 - 它根本不起作用。 如果我在 chrome -> source -> localhost:3000/home/user/project/src/components/Component 中转到开发人员工具,我在那里设置断点,然后在 VS Code 中看到同一个文件,但文件的路径很奇怪 \home\user\project\src\components\Component

我认为源地图有问题,但无法弄清楚究竟是什么。 如果我在 Windows 断点运行相同的代码。

有没有人有在 WSL 中调试 VS Code 的经验?对这个问题有什么想法吗?

【问题讨论】:

标签: visual-studio-code create-react-app windows-subsystem-for-linux vscode-debugger chrome-debugging


【解决方案1】:

wsl 容器有它自己的文件系统,所以你需要远程 wsl 调试扩展。

https://code.visualstudio.com/docs/remote/wsl

使用 Linux @eugene-monakoff

【讨论】:

  • 这个答案一点帮助都没有。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2019-06-26
  • 2019-05-30
  • 2017-02-11
  • 1970-01-01
  • 2022-07-19
  • 2022-11-24
  • 2022-01-11
相关资源
最近更新 更多