- Open the Brave/Chrome dev tools - brave://inspect/#devices
- Click on
Open dedicated DevTools for Node
- Log in to the remote host:
ssh USER@REMOTE_IP
- Figure out how to add
--inspect-brk
to the startup for your app - Bounce the app with whatever process manager you use
- Check the logs for a line that looks like this:
Debugger listening on ws://127.0.0.1:9229/df2da178-0e77-4b09-8f61-0e43cda1bc64
Note the port number. Your debugger must have a connection listener on this port!
- In a new terminal, open the SSH tunnel:
ssh -L 9229:localhost:9229 -N USER@REMOTE_IP
- The debugger should jump into focus, click the blue 'play' button in the top right to continue starting the app
- Once the app is started, set breakpoints and begin debugging