![]() If your application structure is complicated, additional manual configuration is required. In most cases, WebStorm sets path mappings automatically by reusing mappings from the deployment configuration. When you have defined several resource root folders in addition to the project root. When your application is deployed and running on a remote web server. Mappings set correspondence between files on a web server and their local copies. Now we can start debugging: choose the new run/debug configuration from the list in the upper right-hand corner of the WebStorm window, and then click the Debug button ( ) to the right of the list: In our example, the local project structure and file structure on the server are the same so no mappings are required. Specify the URL of your running application: In the Run/Debug Configurations dialog, click and choose JavaScript Debug from the list: Alternatively, choose Run | Edit Configurations from the main menu: To do that, click the list at the upper right-hand corner of the WebStorm window and choose Edit Configurations. When using a local web server, such as Nginx or Apache, as in our example, or the web server is on a remote host, you need to create a Run/Debug configuration to start the JavaScript debugger. Let's now deploy our simple application to a local web server, see Deploy your application. Suppose you have a simple application that consists of an index.html file and an App.js file, where index.html references App.js. To open a new Chrome instance with your familiar look-and-feel, configure Chrome in WebStorm to start with your user data, see Starting a debugging session with your default Chrome user data for details. In the Debug tool window, proceed as usual: step through the program, stop and resume the program execution, examine it when suspended, view actual HTML DOM, run JavaScript code snippets in the Console, and so on.īy default, a debugging session starts in a new window with a custom Chrome user data. The HTML file specified in the run configuration opens in the chosen browser and the Debug tool window appears. See Configure synchronization with a server for details.Ĭlick OK to save the configuration settings.Ĭhoose the newly created configuration in the Select run/debug configuration list on the toolbar and click the Debug button. This URL address should be a concatenation of the Web server root URL and the path to the HTML file relative to the web server document root in accordance with server access configuration. In the Run/Debug Configuration: JavaScript Debug dialog that opens, specify the URL address at which the application is running. Set the breakpoints in the JavaScript code, as required.Ĭreate a run/debug configuration of the JavaScript Debug type:įrom the main menu, choose Run | Edit Configurations, then in the Edit Configurations dialog, in the Edit Configurations dialog that opens, click the Add button ( ) on the toolbar and select JavaScript Debug from the list. Debugging an application on a remote server ![]() To synchronize local and remote sources, create a deployment configuration as described in Create a remote server configuration and Configure synchronization with a server. To debug an application on a remote web server, you need to have the copies of its sources in a WebStorm project. How do I synchronize my application sources on the server with their local copies in my WebStorm project? ![]() This server may be actually running on a physically remote host or on your machine.įor example, if your project is in C:/WebStormProjects/MyProject and the web server document root is C:/XAMPP/htdocs, for WebStorm this web server is remote. In WebStorm, any server with the document root outside the current project is called remote. For more details about the live editing functionality, see Live Edit in HTML, CSS, and JavaScript. To have the changes you make to your HTML, CSS, or JavaScript code immediately shown in the browser without reloading the page, activate the Live Edit functionality. For more details about plugins, see Managing plugins.Ĭonfigure the built-in debugger as described in Configuring JavaScript debugger. ![]() In the search field, type JavaScript Debugger. Press Ctrl+Alt+S to open the IDE settings and select Plugins. Make sure the JavaScript Debugger bundled plugin is enabled in the settings. Debugging JavaScript Deployed to a Remote Serverĭebugging of JavaScript code is only supported in Google Chrome and in other Chromium-based browsers.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |