Once the breakpoint is hit, you can step through the code and do everything you would when debugging a JavaScript app.Īttaching debugger to the running node process Put the breakpoints and start the debug configuration ( Ctrl-D on macOS or Shift+F9 on Windows & Linux). Good news: you can still debug this app with WebStorm! In the cases we described above, the application is actually started from WebStorm, but sometimes you may want to attach to a process that is already running (for example, in a Docker container started on your machine). To be able to connect to the running process, you need to start it with the debugging flags. If you used the `–inspect` flag, create and use a new Chromium Remote debug configuration.If you use the -debug flag, create a Node.js Remote Debug configuration in WebStorm and specify the host (for a local machine it’s localhost) and the port number you’ve used in it.You can use -inspect=port number for Node.js versions 6.5+, and/or -debug=port number for any Node.js versions earlier than 8. Put breakpoints in the code, run the app, and then run the newly created debug configuration. Running node apps in Docker from WebStorm If you want the execution to stop on the first line of the app and wait till you attach the debugger to it, use the -inspect-brk flag. WebStorm can also run the node app in the Docker container, and then connect to it with debugger. For more details on that, see our blog post, Quick tour of WebStorm and Docker. You can also find information on developing, running and debugging Node.js apps in WebStorm in its online documentation.I've recently been looking at how people debug Typescript applications. It's pretty straight forward, all you have to do is set up the execution script in Webstorm (or any IDE really) and you're good to go. This configuration will definitely help you get started understanding the framework and squashing those pesky scripting bugs.The problem is that that solution assumes we are running the application directly off our PCs. This debug configuration may be obvious to a seasoned node developer, but if you're a language transplant like me, you may need help getting started with debugging serverless using WebStorm. If you launch the Configuration as debug, the WebStorm debugger will automatically be hooked into the node process.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |