On this page
Effectively debugging web apps takes effort, especially when an HTTP request goes through multiple layers before reaching your web app. Follow the steps below to debug a specific app.
You can choose to debug in an environment deployed to Platform.sh or with your app running locally but connected to deployed services. In either case, make sure to debug in a preview environment.
For more general information, see how to troubleshoot development.
Start by creating a new environment completely isolated from production but with the same data for debugging:
platform branch debug-branch
<START_FILE> with the file defined for your app’s
You get output something like this:
Debugger listening on ws://127.0.0.1:9229/10701e5d-d627-4180-a967-d47a924c93c0
For help, see: https://nodejs.org/en/docs/inspector
Listening on port 8888
In another terminal, create an SSH tunnel that forwards to the 9229 port:
ssh -N -L 9229:localhost:9229 $(platform ssh --pipe)
You can now connect the debugger as if you were debugging a local application. See examples with some common tools:
Now when you load the site at your deployed URL (if debugging remote) or localhost (if debugging locally), the local debugger you’ve attached is called.
If you’re using the
pm2 process manager to start your app from a script,
you might find it daemonizes itself and blocks other processes (such as backups) by constantly respawning.
This may happen even if you use the
Instead of using a script, call
pm2 start directly in your