Debugging a Service
* 
We recommend that you disable the JavaScript Debugger in production environments. In the JavaScript Debugger, the JavaScript is optimized for reduced runtime and compiled with the debugging information, which can impact system performance. To avoid performance degradation in your production environment, only use the JavaScript Debugger in development and test environments.
To start debugging a service using the JavaScript Debugger, perform the following steps:
1. From Composer, click Modeling > Things.
2. Select a Thing from the list.
The General Information tab for the selected Thing appears.
3. Click the Services tab, and select the JavaScript service that you want to debug.
The code for the service appears in the script editor.
4. Click the gutter area to the left of the numbered column and add breakpoints to the code.
5. To start debugging, do one of the following:
Under the Execute tab in the script tools pane, click Debug.
Or
Click the Debug tab in the script tools pane, and click .
Or
On the toolbar, click .
Debugging starts. You can monitor the process in the script editor. During debugging, the Debug tab is open in the script tools pane. After debugging, the Execute tab opens and shows the output.
* 
If you step into a different service from the original service, the editor changes to display the code for the newly selected service and the header displays the entity and service that are now being inspected.
JavaScript Debugger Timeout
The JavaScript Debugger times out when the debugging session exceeds the predefined time limit as described below. If a debugging session exceeds the configured script timeout or there is prolonged inactivity, the JavaScript Debugger automatically terminates the debugging session and the user is returned to the script editor. The JavaScript Debugger timeout prevents stalled or resource-intensive debugging sessions from overloading the system and increases system stability, enhances responsiveness, and avoids overuse of resources.
The JavaScript Debugger will time out as follows:
Between breakpoints — After you run a debugging command, the debugger will respond with its state at the next breakpoint. You can set the amount of time allowed between breakpoints in the ScriptTimeout parameter in the platform-settings.json file under BasicSettings. The default value is 30 seconds. If the timeout is reached, the debugger stops.
Between debugging commands — After you start a debugging session, you must provide a command within 30 minutes. This value is the IdleSessionTimeout parameter in the platform-settings.json file under BasicSettings. You cannot change this value. If there is no activity for 30 minutes, the debugger stops.
Was this helpful?