2.1 Script Debugger Overview

Script debugging is an important part of the holistic developer experience. Debugging with Chrome DevTools is the most common way to debug JavaScript. To give NetSuite developers a modern coding experience, we built the 2.1 Script Debugger with Chrome DevTools so you can debug scripts just like you would with JavaScript in Google Chrome.

You access the 2.1 Script Debugger the same way as the legacy Script Debugger for SuiteScript 1.0 and 2.0 scripts. To use the 2.1 Script Debugger, select 2.1 as the API Version on the Script Debugger page. When you click Debug Script, a new browser tab opens with the Chrome DevTools interface for debugging your script. Your script will be displayed on the new tab and you can pause/resume execution, set breakpoints, and step through your code line by line.

The 2.1 Script Debugger is available for all SuiteScript developers.

Note:

Only SuiteScript 2.1 scripts can be debugged using the 2.1 Script Debugger. You can't use the 2.1 Script Debugger to debug SuiteScript 1.0 or 2.0 scripts.

The following SuiteScript 2.1 server script types can be debugged:

NetSuite plans to support debugging SuiteScript 2.1 versions of other script types and core plug-in implementations in a future release. And debugging "Hidden in SuiteBundle" files is not currently supported. See Add the Bundle Installation Script File to the File Cabinet for information about the Hide in SuiteBundle option for Bundle Installation scripts.

Note:

Only one script can be debugged at a time in a given debug session, regardless of the version of the script. You cannot debug a SuiteScript 2.0 script at the same time as a SuiteScript 2.1 script.

The following table lists the Chrome DevTools debugging features and shows whether each is supported in the 2.1 Script Debugger. See Using Chrome DevTools for instructions on each capability.

Most common debugging capabilities in Chrome DevTools for JavaScript code

Supported in 2.1 Script Debugger

Pause your code with breakpoints

Find unused script code

(see Chrome DevTools documentation)

Map preprocesses code to source

Change thread context

Step through code:

  • step over a line of code

  • step into/out of a line of code

  • run all code up to a certain selected line

  • use breakpoints

  • restart at the top function of the call stack

  • pause and resume execution

Set and remove breakpoints

Edit code

View and edit local, closure, and global properties

View current call stack

Copy stack trace

(see Chrome DevTools documentation)

Ignore a script or pattern of scripts

(see Chrome DevTools documentation)

Blackbox a script from the Editor pane, the Call Stack pane, the Settings pane

(see Chrome DevTools documentation)

Display the console

Use the Memory tab

Use the Profiler tab

Searching

Code coverage

Hover over code components shows info and values

De-minify the code

Set up a workspace

Keyboard shortcuts

See https://developers.google.com/web/tools/chrome-devtools/shortcuts

Related Topics

General Notices