Debugging Web Parts
When you create an SPFx solution, the scaffolded project comes with a default Visual Studio Code debug configuration. This configuration is located in the launch.json file in the .vscode folder. This file contains debug configuration for your current project only, for instance, for browsers such as Edge or Chrome (by default, SPFx provides a configuration for Edge only). All the configurations defined in that file are available on the Visual Studio code interface, so you can start them.
A debug configuration in Visual Studio Code has the following fields:
- name: The name of your debug configuration that will appear on the Visual Studio Code dropdown.
- type: Web browser to use (Edge or Chrome). For Firefox, you’ll need a specific Visual Studio code extension. For Edge and Chrome, the rest of the configuration is exactly the same.
- request: The type of debug behavior. Here,- launchwill open the browser and attach the Visual Studio code debugger...
 
                                             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
     
         
                 
                 
                 
                 
                 
                 
                 
                 
                