Debug Dart server and client

Hello!

I have a project in Dart which contains both a client part and a server part. The client part is a GUI that calls into the server part that is a REST service hosted by the Dart web-server using the "shelf" package. What I want to do is to debug both at the same time. Eg. if the client presses a button that initiates a call to the REST service I want to be able to have breakpoints hit in both the client and the server within the same instance of Webstorm. What I have tried so fart is to create two run configurations. One of type Dart Comamndline that start the REST service and one of type Javascript debug which starts the client. In order to start both I've added the commandline run configuration to the "actions before" section of the Javascript debug run configuration. If I then run the JavaScript debug configuration it will start the Dart Commandline configuration which starts the server but then nothing else happens. The webbrowser (Dartium) does not open etc.

So my question is if debugging both Dart client and server in the same Webstorm instance is possible? Anyone else doing something like this?

3 comments

Possible using 2 Run configurations - just like you did it; but adding one of them to 'before launch' section of another won't work, as the main process will wait for return code from the process run in 'before launch' (and thus your client won't start untill server process is terminated). Just run your server configuration and then run a client one. You can record a macro (Edit/Macros) to do this in one step

0

Thank you! Got it to work by starting both run configurations separately!

About the macro tip, I tried to record starting both configs in debug by using the Run > Debug menu. This shows the pop-up to select the config to debug. It records Action: ChooseDebugConfiguration and some keystrokes. But when I replay the macro it shows the popup with the configs list but does not continue to start the config, instead it waits for user input at this point. Is there some other way to record this macto?

0

Please sign in to leave a comment.