You can set breakpoints before or after you
launch a debug session and you can remove breakpoints while a debug
session is in process.
- Open a script file with a
.js
or .ds
extension to debug in the
Studio Commerce Cloud Script Editor or the JSDT editor (which is the
default JavaScript editor for Eclipse).You can modify your Eclipse
preferences to make the Commerce Cloud Script Editor you default
JavaScript editor if you want to use the auto complete feature for the
Salesforce B2C Commerce Script API.
Note: Starting in 17.3, UX Studio
enables you to set breakpoints in script files regardless of the
location of the script file relative to the cartridge path. Previously,
the script's cartridge had to be on the Site's cartridge path for the
breakpoint to be registered with the script engine.
- Double-click in the white column to the
left of the code where you want to set your breakpoint. A break point
appears as a blue circle next to the closest appropriate place for a
break. For example, if you click next to a curly brace, the breakpoint
is inserted after the brace.
Note: The overlay to a breakpoint image indicates
that it's installed in the remote server. If the overlay icon is not
there, then either the script debugger isn't running, or the script is
not in the server's cartridge path.
Breakpoints appear in three states:
-
- a
breakpoint when initially set.
-
- a
breakpoint when the script is stopped at the breakpoint
-
- a
breakpoint when it's successfully registered with the debugger. When
you start the debugger, all breakpoints should have a check mark. If a
breakpoint isn't successfully registered, usually because the
debugger can't locate the script, the breakpoint appears as initially
set. If the script completes and one or more breakpoints appear as
initially set, then there is an issue with the communication with the
server or the cartridge isn't in the server's path.