Running and Debugging Dart Web Applications
On this page:
When running and debugging Dart web applications, WebStorm uses the Pub Serve tool. Integration with it is established through the built-in server which acts transparently as a proxy server between your application and the Pub Serve tool. In other words, integration with the Pub Serve tool works invisibly and you do not need to care about it. The tool is invoked automatically when you run or debug a Dart web application, either by opening an HTML file or by launching a run/debug configuration. The tool analyzes the
The work of the Pub Serve tool is logged in the dedicated Pub Serve tool window which opens when you start running or debugging a Dart web application for the first time during the current WebStorm session. You can stop the tool by clicking on the toolbar. As soon as you start running or debugging again, the tool restarts automatically.
Running a Dart web application
No run configuration is required for launching Dart Web applications.
- In the editor, open the HTML file with the Dart reference. This HTML file does not necessarily have to be the one that implements the starting page of the application.
- Do one of the following:
- Choose on the main menu or press Alt+F2. Then select the desired browser from the pop-up menu.
- Hover your mouse pointer over the code to show the browser icons bar: Click the icon that indicates the desired browser.
Debugging a Dart web application
- Install and configure the JetBrains Chrome Extension in your browser, see Installing JetBrains Chrome extension.
- Configure and set breakpoints in the Dart code.
- On the main menu, choose .
Specify the URL address of the HTML file the references the Dart code to debug. Make sure that the port specified in this URL address is the same as the Built-in server port on the Debugger page of the Settings dialog box and the port specified in the settings for the Chrome Extension.
- Initiate a debugging session: choose the created run configuration from the Edit configurations drop-down list on the toolbar and click . WebStorm opens the specified URL in the chosen browser and opens the Debug Tool Window.
- In the Debug tool window, step through the program, stop and resume the program, examine it when suspended, etc. See Stepping Through the Program, Pausing and Resuming the Debugger Session, and Examining Suspended Program for details. ,