小编39d*_*its的帖子

断点无法通过 Windows 10 和 WSL2 上的 Visual Studio Code 在 Chrome 中调试 React 应用程序

在今年的 MSBuild 会议和终端 1.x、winget 和其他附加功能的发布之后,我想在需要购买新笔记本电脑(Surface Book 3 或 MacBook Pro... )。

问题

使用 WSL2 和 Visual Studio Code 在 Windows 10 上的 Chrome 中调试 Web 应用程序时,断点不起作用。运行调试会话时,会显示消息断点设置但尚未绑定

在 MacOS 上调试时,完全相同的应用程序可以完美运行。

我的设置

MacBook Pro 运行最新版本的 MacOS,并在 BootCamp 下安装了 Windows 10 Pro。

Windows 10 有运行 Ubuntu 20.04 的 WSL2。终端 1.x 已安装并用于访问 Linux 命令行。

Visual Studio Code 是最新的 1.45.1 稳定版本,包括 Windows 10 上的 WSL 远程开发扩展 (0.44.2)。VSCode 通过code .在项目目录中运行从 WSL2 中启动。

Chrome 扩展的调试器是 4.12.8

应用程序

该应用程序是一个默认的 Create React App,仅对分配断点进行了很小的更改。

我首先运行:

npx …
Run Code Online (Sandbox Code Playgroud)

debugging google-chrome reactjs visual-studio-code wsl-2

11
推荐指数
2
解决办法
1万
查看次数

对于使用 WSL2 签名的 git 提交,Windows 10 上的 Visual Studio Code 中没有 GPG 密码提示

从 Windows 10 在 WSL2 中提交代码时,我无法在 Visual Studio Code 中使用签名提交。

问题

Windows 10 中未显示密码提示,导致 git 失败 error: gpg failed to sign the data


设置

视窗设置

带有 WSL2 和 Windows 终端的最新版 Windows 10。

Visual Studio Code 安装在 Windows 10 中,是最新版本 (1.48.0),包括最新的远程 WSL 扩展 (v0.44.4)。

我的代码在运行 Ubuntu 20.04 的 WSL2 中,所有软件包都已更新。

Visual Studio Code 是通过命令行使用code .WSL2 中的命令打开的。

Git 设置

Git (2.25.1) 安装在 WSL2 中,全局配置如下:

[user]
    name = My Name
    email = my.email@example.com
    signingkey = A1B2C3D4E5F67890
[commit]
    gpgsign = true
Run Code Online (Sandbox Code Playgroud)

git …

git gnupg visual-studio-code wsl-2

3
推荐指数
2
解决办法
2429
查看次数