3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[WSL] VS Code上でChrome DebuggerのブレイクポイントがUnverified breakpointとなりヒットしない

Last updated at Posted at 2020-01-15

#事象
image.png

ブレイクポイントをセットしても、Unverified breakpoint(未検証のブレイクポイント)となり、セットしたポイントでデバッグが止まりません。

#TL;DR
この記事では、上記の事象を解消します。

#環境

  • WSL Ubuntu 16.04.6 LT

#解決手順

launch.json内で、sourceMapPathOverridesでフォルダのマッピングを定義する必要があるようです。(こちらのオプションの詳細については調べていないため掘り下げません。)

launch.json
{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "chrome",
            "request": "launch",
            "name": "Launch Chrome against localhost",
            "url": "http://localhost:3000",
            "webRoot": "${workspaceFolder}",
            "trace": true,
            "sourceMapPathOverrides": {
                "/mnt/c/*": "C:\\*"
            }
        }
    ]
}

上記の例ではCドライブをマッピングしていますが、もしDドライブにWSLをマウントしているのであれば、 "/mnt/d/*": "D:\\*"となります。

参考文献

3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?