Fore tunnel debugging using VS Code Run&Debug functionality

Hi Colleagues,
I’m now setting up my environment to use Forge Custom-UI with VS Code editor and TypeScript. I’ve already figured out how to debug my application using “forge tunnel --debug” in the VS Code terminal. Still, it allows me to debug the application in a separate Chrome Development environment, but not in VS Code itself. Is it possible to set up VS Code in a way that will allow me to do the same using its internal Run&Debug functionality and not copy-paste the links and switch to Chrome any time I need to debug?

Hi @Provotar - welcome to the Atlassian developer community!

I think you should be able to use the Debug: Attach to Node Process command available in VS Code to attach your IDE to the running forge tunnel:

Selecting this option from the command palette should show you a list of running processes you can connect to.

You can confirm if it works because the tunnel stdout should show the debugger has been attached successfully:

Let me know if this works for you, or if you have any problems!

2 Likes

Thank you @HeyJoe!
I’ve moved one step ahead. Now I can connect to Node process and I see in VS Code console that the debugger is listening on the appropriate ws:// link. But when I put a breakpoint or add “debugger;” to my code in VS Code to stop processing and test the values of the variables, the application doesn’t stop as it does in the Chrome Development environment with “debugger;”. Nothing happened in VS Code. Maybe I missed something else in the VS Code configuration?

Hi @Provotar

I checked with the engineering team, and unfortunately we haven’t fully built out support for the VS Code debugger protocol. The forge debugger has only been tested to work with the Chrome developer tools.

I have created a suggestion for the team to consider adding support for VS Code: https://jira.atlassian.com/browse/ECO-186

2 Likes

Hi @HeyJoe ,
Thank you very much for your help!

This is now supported. Please check out this tutorial https://developer.atlassian.com/platform/forge/debug-functions-using-vscode/

2 Likes

Hi @KhanhNguyen, @HeyJoe ,

This functionality works with forge/resolver resolver backend functions but not with forge/events queue listeners. When I work with Queue and launch backend computation by sending events to the queue, I can’t catch a breakpoint on the listener side. It will be great if forge tunnel debugging can be extended to forge/events Queues as well.