0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

WebStormを用いたReact + Vite + TypeScript アプリケーションのデバッグ方法

Last updated at Posted at 2025-04-27

WebStormでReactアプリケーションの開発時、ブレークポイントで止まってくれないのでアレコレ対応したときのメモ。

前提条件

  • Viteのreactテンプレート(With TypeScript)のプロジェクト
  • 環境は以下
    • WebStorm: 2025.1
    • Node.js: 20.15.0
    • React: 19.0.0
    • TypeScript: 5.7.2
    • Vite: 6.3.1

※ Web開発1ヶ月目の素人による記事です

実際の手順

まずメインメニュー->「実行」->「構成の編集」をクリックする。
image.png

左上の「+」ボタン(新規構成の追加)をクリックし、「JavaScript デバッグ」をクリックする。

「名前」は任意。
「URL」はViteが起動時に表示するURL。

image.png

ここまで設定したら、「OK」を押して戻ります。

そして、npm run dev でアプリケーションを実行した後に、先ほど作成したデバッグ構成を実行してください。
(Viteで開発サーバーを起動している状態でないと、デバッガーの接続先が存在しないためエラーが発生します。)

この状態でブレークポイントを貼るとちゃんと処理の実行時にブレークポイントで止まってくれるようになります。

以上。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?