NodeJS debugging

Post Reply
MTswitch
Newbie
Posts: 12
Joined: Fri Aug 23, 2019 3:18 pm

NodeJS debugging

Post 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 11146 times
i active the flow and press F5 for debugging, but occurred this error :
debugError.PNG
debugError.PNG (10.56 KiB) Viewed 11144 times
could anyone tell me what should i do or clearly explain how to do it. there is not good information in documation
ThomasDeschamps
Member
Posts: 21
Joined: Wed Jul 20, 2016 12:03 pm

Re: NodeJS debugging

Post 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
MTswitch
Newbie
Posts: 12
Joined: Fri Aug 23, 2019 3:18 pm

Re: NodeJS debugging

Post 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
Padawan
Advanced member
Posts: 358
Joined: Mon Jun 12, 2017 8:48 pm
Location: Belgium
Contact:

Re: NodeJS debugging

Post by Padawan »

Is there any error in the messages?
Sunnyland
Member
Posts: 56
Joined: Mon Aug 19, 2013 1:34 am

Re: NodeJS debugging

Post 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 11123 times
Last edited by Sunnyland on Fri Aug 21, 2020 7:08 am, edited 1 time in total.
Sunnyland
Member
Posts: 56
Joined: Mon Aug 19, 2013 1:34 am

Re: NodeJS debugging

Post 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.
Attachments
Untitled.png
Untitled.png (3.2 KiB) Viewed 11123 times
Sunnyland
Member
Posts: 56
Joined: Mon Aug 19, 2013 1:34 am

Re: NodeJS debugging

Post 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.
Sunnyland
Member
Posts: 56
Joined: Mon Aug 19, 2013 1:34 am

Re: NodeJS debugging

Post by Sunnyland »

Untitled2.png
Untitled2.png (4.85 KiB) Viewed 11123 times
MTswitch
Newbie
Posts: 12
Joined: Fri Aug 23, 2019 3:18 pm

Re: NodeJS debugging

Post 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
MTswitch
Newbie
Posts: 12
Joined: Fri Aug 23, 2019 3:18 pm

Re: NodeJS debugging

Post 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 ?
patej
Member
Posts: 79
Joined: Sun Nov 25, 2012 12:15 pm

Re: NodeJS debugging

Post 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...
MTswitch
Newbie
Posts: 12
Joined: Fri Aug 23, 2019 3:18 pm

Re: NodeJS debugging

Post 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
Post Reply