{"id":26056,"date":"2023-07-06T12:00:03","date_gmt":"2023-07-06T16:00:03","guid":{"rendered":"https:\/\/webdevstudios.com\/?p=26056"},"modified":"2024-07-09T17:07:10","modified_gmt":"2024-07-09T21:07:10","slug":"debugging-react-with-vs-code-and-chrome","status":"publish","type":"post","link":"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/","title":{"rendered":"Debugging React with VS Code and Chrome"},"content":{"rendered":"<p>Have you ever considered using a debugger for your React project but decided to keep on using <code>console.log()<\/code> instead because you thought it would be a pain to set up proper debugging?<\/p>\n<p>I did, until one day, I needed to get into the weeds on a project, and I figured I&#8217;d try and set up debugging in hopes of making my life easier. I was delighted to find out how easy it was! In this post, I&#8217;ll demonstrate how to debug a React project using VS Code and Chrome.<\/p>\n<p>To demonstrate how to set things up, I&#8217;m going to use Vite and React to set up a React project. You&#8217;ll need to have VS Code and NPM installed.<\/p>\n<h2>Set Up a Workspace in VS Code<\/h2>\n<p>First, create a directory for our workspace. Then Open the directory in VS Code. Save the workspace.<\/p>\n<p>I used <code>D:devtrainingdebugging-react<\/code>.<\/p>\n<h3>Create a React Starter Project Using Vite<\/h3>\n<p>From VS Code, open up this location in the integrated terminal and run the following command to create a starter project: <code>npm create vite@latest<\/code><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"26059\" data-permalink=\"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/install-vite\/\" data-orig-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/install-vite.png\" data-orig-size=\"678,346\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"install-vite\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/install-vite.png\" class=\"alignnone size-full wp-image-26059\" src=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/install-vite.png\" alt=\"Create a Vite project\" width=\"678\" height=\"346\" srcset=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/install-vite.png 678w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/install-vite-300x153.png 300w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/install-vite-118x60.png 118w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" \/><\/p>\n<p>Follow the prompt from Vite. Give the project a name (I used <code>vite-demo<\/code> ). Select <em>React<\/em> for the framework and <em>JavaScript<\/em> for the variant.<\/p>\n<p>Once that&#8217;s all set, change directories into the project folder that you assigned, run <code>npm install<\/code>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"26060\" data-permalink=\"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/install-packages\/\" data-orig-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/install-packages.png\" data-orig-size=\"687,253\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"install-packages\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/install-packages.png\" class=\"alignnone size-full wp-image-26060\" src=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/install-packages.png\" alt=\"Install packages\" width=\"687\" height=\"253\" srcset=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/install-packages.png 687w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/install-packages-300x110.png 300w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/install-packages-163x60.png 163w\" sizes=\"auto, (max-width: 687px) 100vw, 687px\" \/><\/p>\n<p>Once the installation is complete, start Vite by running <code>npm run dev<\/code>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"26061\" data-permalink=\"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/run-vite\/\" data-orig-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/run-vite.png\" data-orig-size=\"680,299\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"run-vite\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/run-vite.png\" class=\"alignnone size-full wp-image-26061\" src=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/run-vite.png\" alt=\"Run Vite\" width=\"680\" height=\"299\" srcset=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/run-vite.png 680w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/run-vite-300x132.png 300w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/run-vite-136x60.png 136w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/p>\n<p>We can see that our project is running on localhost, port <code>5173<\/code>. A browser window will be opened with the project:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"26062\" data-permalink=\"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/vite-demo-page\/\" data-orig-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/vite-demo-page.png\" data-orig-size=\"548,620\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"vite-demo-page\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/vite-demo-page.png\" class=\"alignnone wp-image-26062 size-full\" src=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/vite-demo-page.png\" alt=\"Vite + React demo page\" width=\"548\" height=\"620\" srcset=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/vite-demo-page.png 548w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/vite-demo-page-265x300.png 265w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/vite-demo-page-53x60.png 53w\" sizes=\"auto, (max-width: 548px) 100vw, 548px\" \/><\/p>\n<h2>Create and Configure a <code>launch.json<\/code> File in VS Code<\/h2>\n<p>Now we need to create a <code>launch.json<\/code> file. Click the Debug icon (1), then <em>create a launch.json file<\/em> (2). The <code>launch.json<\/code> file will be located in your workspace&#8217;s <code>.vscode<\/code> directory.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"26063\" data-permalink=\"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/create-launch-json-file\/\" data-orig-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/create-launch.json-file.png\" data-orig-size=\"892,515\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"create-launch.json-file\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/create-launch.json-file.png\" class=\"alignnone size-full wp-image-26063\" src=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/create-launch.json-file.png\" alt=\"Create launch.json file\" width=\"892\" height=\"515\" srcset=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/create-launch.json-file.png 892w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/create-launch.json-file-300x173.png 300w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/create-launch.json-file-768x443.png 768w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/create-launch.json-file-104x60.png 104w\" sizes=\"auto, (max-width: 892px) 100vw, 892px\" \/><\/p>\n<p>Select the location:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"26064\" data-permalink=\"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/create-launch-json-file-folder-location\/\" data-orig-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/create-launch.json-file-folder-location.png\" data-orig-size=\"775,172\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"create-launch.json-file-folder-location\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/create-launch.json-file-folder-location.png\" class=\"alignnone size-full wp-image-26064\" src=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/create-launch.json-file-folder-location.png\" alt=\"Select the location\" width=\"775\" height=\"172\" srcset=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/create-launch.json-file-folder-location.png 775w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/create-launch.json-file-folder-location-300x67.png 300w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/create-launch.json-file-folder-location-768x170.png 768w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/create-launch.json-file-folder-location-180x40.png 180w\" sizes=\"auto, (max-width: 775px) 100vw, 775px\" \/><\/p>\n<p>Select Chrome for the debugging type:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"26065\" data-permalink=\"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/create-launch-json-file-select-type\/\" data-orig-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/create-launch.json-file-select-type.png\" data-orig-size=\"725,259\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"create-launch.json-file-select-type\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/create-launch.json-file-select-type.png\" class=\"alignnone size-full wp-image-26065\" src=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/create-launch.json-file-select-type.png\" alt=\"Debugging type: Chrome\" width=\"725\" height=\"259\" srcset=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/create-launch.json-file-select-type.png 725w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/create-launch.json-file-select-type-300x107.png 300w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/create-launch.json-file-select-type-168x60.png 168w\" sizes=\"auto, (max-width: 725px) 100vw, 725px\" \/><\/p>\n<p>This will open the <code>launch.json<\/code> file in a tab. (1) Set the port to whatever was specified by Vite earlier (<code>5173<\/code> by default), and (2) add the subdirectory your project is into the <code>webRoot<\/code> option if you have your project in a subdirectory like I do here (<code>\/vite-demo<\/code>).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"26066\" data-permalink=\"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/configure-launch-json\/\" data-orig-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/configure-launch.json_.png\" data-orig-size=\"1002,492\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"configure-launch.json\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/configure-launch.json_.png\" class=\"alignnone wp-image-26066 size-full\" src=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/configure-launch.json_.png\" alt=\"Configure launch.json file in VS Code\" width=\"1002\" height=\"492\" srcset=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/configure-launch.json_.png 1002w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/configure-launch.json_-300x147.png 300w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/configure-launch.json_-768x377.png 768w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/configure-launch.json_-122x60.png 122w\" sizes=\"auto, (max-width: 1002px) 100vw, 1002px\" \/><\/p>\n<h3>Add a Breakpoint to the Code<\/h3>\n<p>Now open up your project&#8217;s <code>src\/App.jsx<\/code>file (1) and (2) add a breakpoint to line 20. We&#8217;re going to debug the <code>count<\/code> variable.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"26067\" data-permalink=\"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/add-breakpoint-2\/\" data-orig-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/add-breakpoint.png\" data-orig-size=\"1307,878\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"add-breakpoint\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/add-breakpoint-1024x688.png\" class=\"alignnone size-full wp-image-26067\" src=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/add-breakpoint.png\" alt=\"Add a breakpoint\" width=\"1307\" height=\"878\" srcset=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/add-breakpoint.png 1307w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/add-breakpoint-300x202.png 300w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/add-breakpoint-1024x688.png 1024w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/add-breakpoint-768x516.png 768w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/add-breakpoint-89x60.png 89w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/add-breakpoint-1300x873.png 1300w\" sizes=\"auto, (max-width: 1307px) 100vw, 1307px\" \/><\/p>\n<h2>Start Debugging Your React Project!<\/h2>\n<p>OK, we&#8217;re getting close! Now click the Start button to start debugging. This will launch our app in a new Chrome window.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"26068\" data-permalink=\"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/start-debugging-2\/\" data-orig-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/start-debugging.png\" data-orig-size=\"896,572\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"start-debugging\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/start-debugging.png\" class=\"alignnone size-full wp-image-26068\" src=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/start-debugging.png\" alt=\"Start debugging\" width=\"896\" height=\"572\" srcset=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/start-debugging.png 896w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/start-debugging-300x192.png 300w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/start-debugging-768x490.png 768w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/start-debugging-94x60.png 94w\" sizes=\"auto, (max-width: 896px) 100vw, 896px\" \/><\/p>\n<p>The app is paused for debugging.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"26069\" data-permalink=\"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/app-opened-for-debugging\/\" data-orig-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/app-opened-for-debugging.png\" data-orig-size=\"608,330\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"app-opened-for-debugging\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/app-opened-for-debugging.png\" class=\"alignnone wp-image-26069 size-full\" src=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/app-opened-for-debugging.png\" alt=\"App opened for debugging in Chrome\" width=\"608\" height=\"330\" srcset=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/app-opened-for-debugging.png 608w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/app-opened-for-debugging-300x163.png 300w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/app-opened-for-debugging-111x60.png 111w\" sizes=\"auto, (max-width: 608px) 100vw, 608px\" \/><\/p>\n<p>A debugging session is now active in VS Code. We can use the debugging control bar to step through and inspect the code.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"26070\" data-permalink=\"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/debugging-session-active\/\" data-orig-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-session-active.png\" data-orig-size=\"1710,649\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"debugging-session-active\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-session-active-1024x389.png\" class=\"alignnone size-full wp-image-26070\" src=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-session-active.png\" alt=\"Debugging session is now active\" width=\"1710\" height=\"649\" srcset=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-session-active.png 1710w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-session-active-300x114.png 300w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-session-active-1024x389.png 1024w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-session-active-768x291.png 768w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-session-active-1536x583.png 1536w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-session-active-158x60.png 158w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-session-active-1300x493.png 1300w\" sizes=\"auto, (max-width: 1710px) 100vw, 1710px\" \/><\/p>\n<p>We can interact with the app and see the value of the counter increase after clicking the count button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"26071\" data-permalink=\"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/counter\/\" data-orig-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/counter.png\" data-orig-size=\"475,464\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"counter\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/counter.png\" class=\"alignnone size-full wp-image-26071\" src=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/counter.png\" alt=\"Click the counter\" width=\"475\" height=\"464\" srcset=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/counter.png 475w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/counter-300x293.png 300w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/counter-61x60.png 61w\" sizes=\"auto, (max-width: 475px) 100vw, 475px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"26072\" data-permalink=\"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/inspect-the-value-of-counter\/\" data-orig-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/inspect-the-value-of-counter.png\" data-orig-size=\"1665,801\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"inspect-the-value-of-counter\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/inspect-the-value-of-counter-1024x493.png\" class=\"alignnone size-full wp-image-26072\" src=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/inspect-the-value-of-counter.png\" alt=\"Observe counter value\" width=\"1665\" height=\"801\" srcset=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/inspect-the-value-of-counter.png 1665w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/inspect-the-value-of-counter-300x144.png 300w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/inspect-the-value-of-counter-1024x493.png 1024w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/inspect-the-value-of-counter-768x369.png 768w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/inspect-the-value-of-counter-1536x739.png 1536w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/inspect-the-value-of-counter-125x60.png 125w, https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/inspect-the-value-of-counter-1300x625.png 1300w\" sizes=\"auto, (max-width: 1665px) 100vw, 1665px\" \/><\/p>\n<p>Here&#8217;s a quick screen capture showing this in action:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"26073\" data-permalink=\"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/debugging-js-in-vs-code\/\" data-orig-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-js-in-vs-code.gif\" data-orig-size=\"1907,1093\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"debugging-js-in-vs-code\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-js-in-vs-code.gif\" class=\"alignnone size-full wp-image-26073\" src=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-js-in-vs-code.gif\" alt=\"Debugging screen capture\" width=\"1907\" height=\"1093\" \/><\/p>\n<p>One thing to note is that, by default, <code>React.StrictMode<\/code> is enabled in dev mode, so your app will be run twice. See <a href=\"https:\/\/react.dev\/reference\/react\/StrictMode\">the docs<\/a> for details on Strict Mode.<\/p>\n<p>That&#8217;s all there is to setting up basic React debugging in VS Code and Chrome. I hope this helps you to more efficiently debug your React projects.<\/p>\n<hr \/>\n<p><em>Are you struggling with WordPress security? Our free guide teaches you everything you need to know to protect your site. Download and read our &#8220;<a href=\"https:\/\/webdevstudios.com\/wordpress-security-enterprise-guide\/\">Guide to WordPress Security<\/a>&#8221; to safeguard your website.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Have you ever considered using a debugger for your React project but decided to keep on using console.log() instead because you thought it would be a pain to set up proper debugging? I did, until one day, I needed to get into the weeds on a project, and I figured I&#8217;d try and set up <a class=\"more-link\" href=\"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/\">Read More<span class=\"screen-reader-text\"> Debugging React with VS Code and Chrome<\/span><\/a><\/p>\n","protected":false},"author":132,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"jetpack_post_was_ever_published":false,"footnotes":""},"categories":[357,954],"tags":[3695,8536,11832],"coauthors":[13188],"class_list":["post-26056","post","type-post","status-publish","format-standard","hentry","category-debugging","category-javascript","tag-chrome","tag-react","tag-vs-code"],"acf":{"blog_hero_image":{"ID":26074,"id":26074,"title":"debugging-react-vscode-ambush-bug-dave-romsey","filename":"debugging-react-vscode-ambush-bug-dave-romsey-1.jpg","filesize":397559,"url":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-react-vscode-ambush-bug-dave-romsey-1.jpg","link":"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/debugging-react-vscode-ambush-bug-dave-romsey-2\/","alt":"","author":"132","description":"","caption":"","name":"debugging-react-vscode-ambush-bug-dave-romsey-2","status":"inherit","uploaded_to":26056,"date":"2023-04-13 13:37:27","modified":"2023-04-13 13:37:27","menu_order":0,"mime_type":"image\/jpeg","type":"image","subtype":"jpeg","icon":"https:\/\/webdevstudios.com\/wp-includes\/images\/media\/default.png","width":2000,"height":1333,"sizes":{"thumbnail":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-react-vscode-ambush-bug-dave-romsey-1-150x150.jpg","thumbnail-width":150,"thumbnail-height":150,"medium":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-react-vscode-ambush-bug-dave-romsey-1-300x200.jpg","medium-width":300,"medium-height":200,"medium_large":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-react-vscode-ambush-bug-dave-romsey-1-768x512.jpg","medium_large-width":768,"medium_large-height":512,"large":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-react-vscode-ambush-bug-dave-romsey-1-1024x682.jpg","large-width":850,"large-height":566,"1536x1536":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-react-vscode-ambush-bug-dave-romsey-1-1536x1024.jpg","1536x1536-width":1536,"1536x1536-height":1024,"2048x2048":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-react-vscode-ambush-bug-dave-romsey-1.jpg","2048x2048-width":2000,"2048x2048-height":1333,"featured-work-lg":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-react-vscode-ambush-bug-dave-romsey-1-436x511.jpg","featured-work-lg-width":436,"featured-work-lg-height":511,"featured-work-sm":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-react-vscode-ambush-bug-dave-romsey-1-436x241.jpg","featured-work-sm-width":436,"featured-work-sm-height":241,"book-cover":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-react-vscode-ambush-bug-dave-romsey-1-235x300.jpg","book-cover-width":235,"book-cover-height":300,"home-hero":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-react-vscode-ambush-bug-dave-romsey-1-1350x440.jpg","home-hero-width":1350,"home-hero-height":440,"services-screenshot":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-react-vscode-ambush-bug-dave-romsey-1-590x790.jpg","services-screenshot-width":590,"services-screenshot-height":790,"single-blog-featured":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-react-vscode-ambush-bug-dave-romsey-1-1920x625.jpg","single-blog-featured-width":1920,"single-blog-featured-height":625,"single-blog-inline":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-react-vscode-ambush-bug-dave-romsey-1-850x360.jpg","single-blog-inline-width":850,"single-blog-inline-height":360,"grid-image":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-react-vscode-ambush-bug-dave-romsey-1-420x420.jpg","grid-image-width":420,"grid-image-height":420,"logo-train":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-react-vscode-ambush-bug-dave-romsey-1-90x60.jpg","logo-train-width":90,"logo-train-height":60,"simple-header":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-react-vscode-ambush-bug-dave-romsey-1-1920x191.jpg","simple-header-width":1920,"simple-header-height":191,"full-width":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-react-vscode-ambush-bug-dave-romsey-1-1620x1080.jpg","full-width-width":1620,"full-width-height":1080,"fifty-fifty-media":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-react-vscode-ambush-bug-dave-romsey-1-1300x866.jpg","fifty-fifty-media-width":1300,"fifty-fifty-media-height":866,"gform-image-choice-sm":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-react-vscode-ambush-bug-dave-romsey-1.jpg","gform-image-choice-sm-width":300,"gform-image-choice-sm-height":200,"gform-image-choice-md":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-react-vscode-ambush-bug-dave-romsey-1.jpg","gform-image-choice-md-width":400,"gform-image-choice-md-height":267,"gform-image-choice-lg":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/debugging-react-vscode-ambush-bug-dave-romsey-1.jpg","gform-image-choice-lg-width":600,"gform-image-choice-lg-height":400}}},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.5 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Debugging React with VS Code and Chrome - WebDevStudios<\/title>\n<meta name=\"description\" content=\"Have you ever considered using a debugger for your React project but decided to keep on using console.log() instead because you thought it would be a pain Learn how to debug React using VS Code and Chrome\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Debugging React with VS Code and Chrome\" \/>\n<meta property=\"og:description\" content=\"Have you ever considered using a debugger for your React project but decided to keep on using console.log() instead because you thought it would be a pain Learn how to debug React using VS Code and Chrome\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/\" \/>\n<meta property=\"og:site_name\" content=\"WebDevStudios\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/webdevstudios\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-06T16:00:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-09T21:07:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/Copy-of-Blog-Post-Template.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Dave Romsey\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webdevstudios\" \/>\n<meta name=\"twitter:site\" content=\"@webdevstudios\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dave Romsey\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/2023\\\/07\\\/06\\\/debugging-react-with-vs-code-and-chrome\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/2023\\\/07\\\/06\\\/debugging-react-with-vs-code-and-chrome\\\/\"},\"author\":{\"name\":\"Dave Romsey\",\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/#\\\/schema\\\/person\\\/ededd1a789bcd1d0ee42a9d2a40be901\"},\"headline\":\"Debugging React with VS Code and Chrome\",\"datePublished\":\"2023-07-06T16:00:03+00:00\",\"dateModified\":\"2024-07-09T21:07:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/2023\\\/07\\\/06\\\/debugging-react-with-vs-code-and-chrome\\\/\"},\"wordCount\":534,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/2023\\\/07\\\/06\\\/debugging-react-with-vs-code-and-chrome\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/webdevstudios.com\\\/wp-content\\\/uploads\\\/2023\\\/04\\\/install-vite.png\",\"keywords\":[\"Chrome\",\"React\",\"VS Code\"],\"articleSection\":[\"Debugging\",\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/webdevstudios.com\\\/2023\\\/07\\\/06\\\/debugging-react-with-vs-code-and-chrome\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/2023\\\/07\\\/06\\\/debugging-react-with-vs-code-and-chrome\\\/\",\"url\":\"https:\\\/\\\/webdevstudios.com\\\/2023\\\/07\\\/06\\\/debugging-react-with-vs-code-and-chrome\\\/\",\"name\":\"Debugging React with VS Code and Chrome - WebDevStudios\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/2023\\\/07\\\/06\\\/debugging-react-with-vs-code-and-chrome\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/2023\\\/07\\\/06\\\/debugging-react-with-vs-code-and-chrome\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/webdevstudios.com\\\/wp-content\\\/uploads\\\/2023\\\/04\\\/install-vite.png\",\"datePublished\":\"2023-07-06T16:00:03+00:00\",\"dateModified\":\"2024-07-09T21:07:10+00:00\",\"description\":\"Have you ever considered using a debugger for your React project but decided to keep on using console.log() instead because you thought it would be a pain Learn how to debug React using VS Code and Chrome\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/2023\\\/07\\\/06\\\/debugging-react-with-vs-code-and-chrome\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/webdevstudios.com\\\/2023\\\/07\\\/06\\\/debugging-react-with-vs-code-and-chrome\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/2023\\\/07\\\/06\\\/debugging-react-with-vs-code-and-chrome\\\/#primaryimage\",\"url\":\"https:\\\/\\\/webdevstudios.com\\\/wp-content\\\/uploads\\\/2023\\\/04\\\/install-vite.png\",\"contentUrl\":\"https:\\\/\\\/webdevstudios.com\\\/wp-content\\\/uploads\\\/2023\\\/04\\\/install-vite.png\",\"width\":678,\"height\":346,\"caption\":\"Create a Vite project\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/2023\\\/07\\\/06\\\/debugging-react-with-vs-code-and-chrome\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/webdevstudios.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Debugging React with VS Code and Chrome\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/#website\",\"url\":\"https:\\\/\\\/webdevstudios.com\\\/\",\"name\":\"WebDevStudios\",\"description\":\"WordPress Design and Development Agency\",\"publisher\":{\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/webdevstudios.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/#organization\",\"name\":\"WebDevStudios\",\"url\":\"https:\\\/\\\/webdevstudios.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/webdevstudios.com\\\/wp-content\\\/uploads\\\/2019\\\/07\\\/wds-amp-logo.png\",\"contentUrl\":\"https:\\\/\\\/webdevstudios.com\\\/wp-content\\\/uploads\\\/2019\\\/07\\\/wds-amp-logo.png\",\"width\":173,\"height\":60,\"caption\":\"WebDevStudios\"},\"image\":{\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"http:\\\/\\\/facebook.com\\\/webdevstudios\",\"https:\\\/\\\/x.com\\\/webdevstudios\",\"http:\\\/\\\/instagram.com\\\/webdevstudios\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/webdevstudios-llc-\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/#\\\/schema\\\/person\\\/ededd1a789bcd1d0ee42a9d2a40be901\",\"name\":\"Dave Romsey\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c9156687896b57fa3611ebe0c876623d043a4edb88179f986c27c04232201728?s=96&d=mm&r=g1745ea464d21ac3e01b84b7c1e90810d\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c9156687896b57fa3611ebe0c876623d043a4edb88179f986c27c04232201728?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c9156687896b57fa3611ebe0c876623d043a4edb88179f986c27c04232201728?s=96&d=mm&r=g\",\"caption\":\"Dave Romsey\"},\"description\":\"David (Dave) is a Senior Backend Engineer at WebDevStudios where he works on WordPress plugins, themes, and web applications. He loves building solutions that help enable clients to achieve their goals. After graduating from Kent State University with a Bachelor\u2019s Degree in Computer Information Systems, Dave started working at Go Media Inc., where he successfully lobbied to adopt WordPress as the preferred platform to build solutions with, crediting its ease of use for both developers and end users. During his tenure, David created starter themes and various plugins which he used along with the team to build custom WordPress solutions for a wide range of clients. He has racked up over 10 years of experience developing with WordPress and has loved watching it evolve year after year. Prior to starting his career in web development, Dave established a strong background in customer service, where he once used The Telephone Doctors Swear Stopper to diffuse a tense situation. He also has a great sense of humor and is totally not writing this about himself. Dave has tons of hobbies and is always getting into something new, so he\u2019s never bored. He enjoys macro photography (particularly insect portraiture), riding his bike on the trail, cooking, playing darts, and hanging out with his two sassy teenage girls, Deedlit and Snarf.\",\"url\":\"https:\\\/\\\/webdevstudios.com\\\/author\\\/david-romseywebdevstudios-com\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Debugging React with VS Code and Chrome - WebDevStudios","description":"Have you ever considered using a debugger for your React project but decided to keep on using console.log() instead because you thought it would be a pain Learn how to debug React using VS Code and Chrome","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/","og_locale":"en_US","og_type":"article","og_title":"Debugging React with VS Code and Chrome","og_description":"Have you ever considered using a debugger for your React project but decided to keep on using console.log() instead because you thought it would be a pain Learn how to debug React using VS Code and Chrome","og_url":"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/","og_site_name":"WebDevStudios","article_publisher":"http:\/\/facebook.com\/webdevstudios","article_published_time":"2023-07-06T16:00:03+00:00","article_modified_time":"2024-07-09T21:07:10+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/Copy-of-Blog-Post-Template.png","type":"image\/png"}],"author":"Dave Romsey","twitter_card":"summary_large_image","twitter_creator":"@webdevstudios","twitter_site":"@webdevstudios","twitter_misc":{"Written by":"Dave Romsey","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/#article","isPartOf":{"@id":"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/"},"author":{"name":"Dave Romsey","@id":"https:\/\/webdevstudios.com\/#\/schema\/person\/ededd1a789bcd1d0ee42a9d2a40be901"},"headline":"Debugging React with VS Code and Chrome","datePublished":"2023-07-06T16:00:03+00:00","dateModified":"2024-07-09T21:07:10+00:00","mainEntityOfPage":{"@id":"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/"},"wordCount":534,"commentCount":0,"publisher":{"@id":"https:\/\/webdevstudios.com\/#organization"},"image":{"@id":"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/#primaryimage"},"thumbnailUrl":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/install-vite.png","keywords":["Chrome","React","VS Code"],"articleSection":["Debugging","JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/","url":"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/","name":"Debugging React with VS Code and Chrome - WebDevStudios","isPartOf":{"@id":"https:\/\/webdevstudios.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/#primaryimage"},"image":{"@id":"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/#primaryimage"},"thumbnailUrl":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/install-vite.png","datePublished":"2023-07-06T16:00:03+00:00","dateModified":"2024-07-09T21:07:10+00:00","description":"Have you ever considered using a debugger for your React project but decided to keep on using console.log() instead because you thought it would be a pain Learn how to debug React using VS Code and Chrome","breadcrumb":{"@id":"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/#primaryimage","url":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/install-vite.png","contentUrl":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2023\/04\/install-vite.png","width":678,"height":346,"caption":"Create a Vite project"},{"@type":"BreadcrumbList","@id":"https:\/\/webdevstudios.com\/2023\/07\/06\/debugging-react-with-vs-code-and-chrome\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webdevstudios.com\/"},{"@type":"ListItem","position":2,"name":"Debugging React with VS Code and Chrome"}]},{"@type":"WebSite","@id":"https:\/\/webdevstudios.com\/#website","url":"https:\/\/webdevstudios.com\/","name":"WebDevStudios","description":"WordPress Design and Development Agency","publisher":{"@id":"https:\/\/webdevstudios.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webdevstudios.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webdevstudios.com\/#organization","name":"WebDevStudios","url":"https:\/\/webdevstudios.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webdevstudios.com\/#\/schema\/logo\/image\/","url":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2019\/07\/wds-amp-logo.png","contentUrl":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2019\/07\/wds-amp-logo.png","width":173,"height":60,"caption":"WebDevStudios"},"image":{"@id":"https:\/\/webdevstudios.com\/#\/schema\/logo\/image\/"},"sameAs":["http:\/\/facebook.com\/webdevstudios","https:\/\/x.com\/webdevstudios","http:\/\/instagram.com\/webdevstudios","https:\/\/www.linkedin.com\/company\/webdevstudios-llc-\/"]},{"@type":"Person","@id":"https:\/\/webdevstudios.com\/#\/schema\/person\/ededd1a789bcd1d0ee42a9d2a40be901","name":"Dave Romsey","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c9156687896b57fa3611ebe0c876623d043a4edb88179f986c27c04232201728?s=96&d=mm&r=g1745ea464d21ac3e01b84b7c1e90810d","url":"https:\/\/secure.gravatar.com\/avatar\/c9156687896b57fa3611ebe0c876623d043a4edb88179f986c27c04232201728?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c9156687896b57fa3611ebe0c876623d043a4edb88179f986c27c04232201728?s=96&d=mm&r=g","caption":"Dave Romsey"},"description":"David (Dave) is a Senior Backend Engineer at WebDevStudios where he works on WordPress plugins, themes, and web applications. He loves building solutions that help enable clients to achieve their goals. After graduating from Kent State University with a Bachelor\u2019s Degree in Computer Information Systems, Dave started working at Go Media Inc., where he successfully lobbied to adopt WordPress as the preferred platform to build solutions with, crediting its ease of use for both developers and end users. During his tenure, David created starter themes and various plugins which he used along with the team to build custom WordPress solutions for a wide range of clients. He has racked up over 10 years of experience developing with WordPress and has loved watching it evolve year after year. Prior to starting his career in web development, Dave established a strong background in customer service, where he once used The Telephone Doctors Swear Stopper to diffuse a tense situation. He also has a great sense of humor and is totally not writing this about himself. Dave has tons of hobbies and is always getting into something new, so he\u2019s never bored. He enjoys macro photography (particularly insect portraiture), riding his bike on the trail, cooking, playing darts, and hanging out with his two sassy teenage girls, Deedlit and Snarf.","url":"https:\/\/webdevstudios.com\/author\/david-romseywebdevstudios-com\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3WX6u-6Mg","amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webdevstudios.com\/wp-json\/wp\/v2\/posts\/26056","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webdevstudios.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webdevstudios.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webdevstudios.com\/wp-json\/wp\/v2\/users\/132"}],"replies":[{"embeddable":true,"href":"https:\/\/webdevstudios.com\/wp-json\/wp\/v2\/comments?post=26056"}],"version-history":[{"count":0,"href":"https:\/\/webdevstudios.com\/wp-json\/wp\/v2\/posts\/26056\/revisions"}],"wp:attachment":[{"href":"https:\/\/webdevstudios.com\/wp-json\/wp\/v2\/media?parent=26056"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webdevstudios.com\/wp-json\/wp\/v2\/categories?post=26056"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webdevstudios.com\/wp-json\/wp\/v2\/tags?post=26056"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/webdevstudios.com\/wp-json\/wp\/v2\/coauthors?post=26056"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}