Debugging

Step-through debugging for SFCC server-side scripts

Intellij SFCC integrates with the SFCC Script Debugger to provide a full debugging experience inside your JetBrains IDE.

Setting Up the Debugger

Configure Connection

Ensure your sandbox connection is configured in Settings → Tools → Intellij SFCC → Connections.

Enable Script Debugger

In Business Manager, go to Administration → Site Development → Development Setup and enable the script debugger.

Start Debug Session

Click Run → Debug or press Shift+F9 to start a debug session. The plugin connects to your sandbox debugger.

Set Breakpoints

Click in the gutter next to any line in a .js controller or script file to set a breakpoint.

The script debugger must be enabled in Business Manager for each sandbox. It's disabled by default for security and performance reasons.

Debugger Features

Breakpoints

TypeDescription
Line breakpointsPause execution at a specific line
Conditional breakpointsPause only when a condition is true
Log breakpointsLog a message without pausing
Exception breakpointsPause on thrown exceptions

Variable Inspection

When paused at a breakpoint, inspect:

  • Local variables - all variables in the current scope
  • Closure variables - variables captured from outer scopes
  • Global objects - session, request, response, customer
  • DW API objects - full property expansion for API objects

Call Stack

View the full call stack with:

  • Navigation to any frame in the stack
  • Variable values at each stack frame
  • Controller → Pipeline → Script chain visualization

Debugging Controllers

Debug SFRA controllers by setting breakpoints in route handlers:

server.get('Show', function (req, res, next) {
    // Set a breakpoint here ← 🔴
    var accountModel = getModel(req);
    res.render('account/accountDashboard', {
        account: accountModel
    });
    next();
});

Trigger the breakpoint by navigating to the corresponding route in your browser (e.g., https://your-sandbox.demandware.net/on/demandware.store/Sites-Site/default/Account-Show).

Debugging Tips

On this page