# Debugging
Debugging a Flutter application can be really helpful when you want to understand and fix errors.
In this topic we will explain how you can debug Flutter applications in VS Code.
# VS Code debugging
Open VS Code and search for the debug icon in the left menu

Click on it and choose for
create a launch.json file

WARNING
If there is already a
launch.jsonfile (or if there are already some configurations defined) you can add a new configuration to theconfigurationsarrayAdd the following content to the
launch.jsonfile:
{
"version": "0.2.0",
"configurations": [
{
"name": "web debugging",
"deviceId": "chrome",
"program": "lib/main.dart",
"request": "launch",
"type": "dart",
"args": [
"--web-port=5000",
"--web-enable-expression-evaluation"
],
},
]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- Launch the debugger and choose the
web debuggingconfiguration

- Add some breakpoints and start debugging
WARNING
- It's possible that VS Code asks you to enable
Flutterweb debugging... - Just click 'Yes' and go for it!