Page 1 of 1

NodeJS debugging

Posted: Thu Aug 20, 2020 1:20 pm
by MTswitch
Hi,
i want to know how can i strat debugging a flow in vscode or better to say how can i debug one script flow in vscode
i set debug mode yes and port 9229 and by vscode in launch.json this setting
set.PNG
set.PNG (20.97 KiB) Viewed 11153 times
i active the flow and press F5 for debugging, but occurred this error :
debugError.PNG
debugError.PNG (10.56 KiB) Viewed 11151 times
could anyone tell me what should i do or clearly explain how to do it. there is not good information in documation

Re: NodeJS debugging

Posted: Thu Aug 20, 2020 3:10 pm
by ThomasDeschamps
These message show-up when VsCode didn't get a return from switch.

There is three main cause :
- Switch flow element is not set-up in debug mode
- Switch flow is not running
- You already done a debug and did'nt restart your switch flow between.


But i agree on that, the documentation is a bit unclear for this process

Re: NodeJS debugging

Posted: Thu Aug 20, 2020 3:54 pm
by MTswitch
ThomasDeschamps wrote: Thu Aug 20, 2020 3:10 pm These message show-up when VsCode didn't get a return from switch.

There is three main cause :
- Switch flow element is not set-up in debug mode
- Switch flow is not running
- You already done a debug and did'nt restart your switch flow between.


But i agree on that, the documentation is a bit unclear for this process
Thank you for your response
i have done everything and still i get the error

Re: NodeJS debugging

Posted: Thu Aug 20, 2020 6:53 pm
by Padawan
Is there any error in the messages?

Re: NodeJS debugging

Posted: Fri Aug 21, 2020 6:57 am
by Sunnyland
Make sure you have the document/file in the folder proceeding the script befofe you start debugging
Untitled.png
Untitled.png (12.46 KiB) Viewed 11130 times

Re: NodeJS debugging

Posted: Fri Aug 21, 2020 7:07 am
by Sunnyland
Make sure you have the document / file in the folder proceeding the script before starting in debug mode.
and start the debugger in attach.

Re: NodeJS debugging

Posted: Fri Aug 21, 2020 7:07 am
by Sunnyland
Make sure you have the document / file in the folder proceeding the script before starting in debug mode.
and start the debugger in attach.

Re: NodeJS debugging

Posted: Fri Aug 21, 2020 7:09 am
by Sunnyland
Untitled2.png
Untitled2.png (4.85 KiB) Viewed 11130 times

Re: NodeJS debugging

Posted: Fri Aug 21, 2020 5:34 pm
by MTswitch
Sunnyland wrote: Fri Aug 21, 2020 7:07 am Make sure you have the document / file in the folder proceeding the script before starting in debug mode.
and start the debugger in attach.
Hi,
Tnaks for your response, yes that was the reason
one file must be in flow

Re: NodeJS debugging

Posted: Mon Oct 05, 2020 1:48 pm
by MTswitch
Hi,

i have another problem and I get the error when I stop the flow manually through the task manager
this is an error " the debugging can be enabled for only one script at a time "
i have tried to change port but it didnt work too
anyone knows where is the problem ?

Re: NodeJS debugging

Posted: Mon Oct 05, 2020 1:55 pm
by patej
Yes I've had the same; if the node script itself breaks, i.e. the debugging session is terminated, Switch continues to wait for response and the Switch_Server process has to be terminated manually. After this the error you mentioned appears and the reason seems to be that Switch is still listening to a main.js debugging in some cache (check the path in the log message) ––> only way we've found around it is to do a Restart Switch Server from File menu before reactivating the flow. Luckily we have a develop server so we can do that quite freely when developing scripts, but of course it would be nice to have lighter solution...

Re: NodeJS debugging

Posted: Mon Oct 05, 2020 2:11 pm
by MTswitch
patej wrote: Mon Oct 05, 2020 1:55 pm only way we've found around it is to do a Restart Switch Server from File menu before reactivating the flow. Luckily we have a develop server so we can do that quite freely when developing scripts, but of course it would be nice to have lighter solution...
Thanks
yes, i do it now but i thought that there is even easier solution for this