> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nextedy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Debug Script Errors

> Identify and resolve errors in your Nextedy GANTT item scripts, configuration scripts, and marker scripts using the built-in error reporting and browser debugging tools.

export const LastReviewed = ({date}) => {
  if (!date) return null;
  const formatted = new Date(`${date}T00:00:00Z`).toLocaleDateString("en-US", {
    year: "numeric",
    month: "long",
    day: "numeric",
    timeZone: "UTC"
  });
  return <p className="mt-10 text-sm text-gray-400 dark:text-zinc-500 not-prose">
      Last reviewed on {formatted}
    </p>;
};

## Locate Script Errors

Since version **25.4.2**, the Gantt provides a built-in error alert system that surfaces script problems directly in the interface.

### Edit Mode (Administrator View)

When a script contains an error, a warning indicator appears in the **Gantt footer**. Click the indicator to open a detailed message that identifies the error type and location:

* **Config Script Error** -- An error in the Gantt configuration script
* **Markers Script Error** -- An error in the markers script
* **Item Script Error** -- An error in the item script

The error count badge on the indicator shows how many distinct errors were detected.

### View Mode (User View)

In view mode (non-edit), a triangle warning icon appears in the Gantt footer when configuration or data-related issues are present. This informs end users that something requires administrator attention.

<Tip title="Errors do not crash the Gantt">
  Script errors are caught and logged. The Gantt continues to render with the remaining valid configuration. Tasks affected by a broken script may appear with default styling instead of custom colors or markers.
</Tip>

## Use the Browser Console

For detailed debugging, open the browser developer console:

1. Right-click anywhere on the Gantt page.
2. Select **Inspect**.
3. Navigate to the **Console** tab.
4. Look for error messages prefixed with the script type.

Script errors are logged with their full stack trace in the browser console, providing the exact line and expression that failed.

## Enable Debug Mode

Set the configuration property `nextedy.gantt.debug` to `true` to enable verbose client-side debug logging:

```
nextedy.gantt.debug=true
```

When debug mode is active, the Gantt logs detailed information about configuration values, data loading, and event processing to the browser console.

<Info title="Verify in application">
  Debug mode can also be enabled via the hamburger menu's Debug submenu in development builds. This provides options to toggle the debug panel and inspect configuration state.
</Info>

## Common Script Error Patterns

| Error Message                                       | Likely Cause                                    | Fix                                                                |
| --------------------------------------------------- | ----------------------------------------------- | ------------------------------------------------------------------ |
| `TypeError: Cannot read property 'id' of undefined` | Pre-2304 script syntax after Polarion upgrade   | Use getter methods: `wi.getType().getId()` instead of `wi.type.id` |
| `ReferenceError: wi is not defined`                 | Script runs on a task with no backing work item | Add a `typeof wi !== 'undefined'` check                            |
| `SyntaxError: Unexpected token`                     | JavaScript syntax error in the script           | Check for missing brackets, quotes, or semicolons                  |

<Warning title="Polarion 2304+ script changes">
  If you recently upgraded Polarion to version 2304 or later, your scripts may need migration. See [Migrate Scripts for Polarion 2304+](/gantt/guides/scripting/script-migration-2304) for a complete before/after reference.
</Warning>

## Debug Server-Side Scripts

Server-side item scripts execute on the Polarion server and log errors to the **server logs**. Contact your Polarion administrator to review the server log files for script evaluation errors.

Server-side scripts have access to context variables including the work item, project, and platform services. Errors in server-side scripts are logged but do not crash the Gantt data load -- affected tasks render with default values.

## Step-by-Step Debugging Workflow

<Frame>
  <img src="https://mintcdn.com/none-17b4493f/umKaPvHwUHw-ZQFM/gantt/diagrams/guides/scripting/debug-scripts/diagram-1.svg?fit=max&auto=format&n=umKaPvHwUHw-ZQFM&q=85&s=177f8c7c068f49d9a05c6dad70eba71b" alt="diagram" style={{ maxWidth: "600px", width: "100%" }} width="600" height="740" data-path="gantt/diagrams/guides/scripting/debug-scripts/diagram-1.svg" />
</Frame>

## Verification

You should now see no error indicators in the Gantt footer after fixing your scripts. The browser console should be free of script-related error messages, and tasks should display with the expected custom colors, markers, and computed values.

## See Also

* [Migrate Scripts for Polarion 2304+](/gantt/guides/scripting/script-migration-2304)
* [Write Item Scripts](/gantt/guides/scripting/item-script-basics)
* [Write Gantt Config Scripts](/gantt/guides/scripting/gantt-config-script)
* [Color Logic Script Examples](/gantt/guides/scripting/color-logic-scripts)
* [Troubleshooting Script Errors](/gantt/guides/troubleshooting/script-errors)

<LastReviewed date="2026-07-02" />
