> ## 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.

# Troubleshooting Script Errors

> This guide helps you identify and resolve errors in Nextedy GANTT item scripts, config scripts, and marker scripts.

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>;
};

## How Script Errors Are Displayed

Since version 25.4.2, the Gantt provides an improved error alert system that makes it easier to identify and resolve script issues.

### In Edit Mode (Administrator View)

When a script contains an error, a footer indicator appears. Clicking it opens a detailed message that identifies the error location. Errors are also logged in the **browser console** and **server logs**.

<Frame>
  <img src="https://mintcdn.com/none-17b4493f/DW7SPQWol8VdzZS9/gantt/images/48001268109/1.png?fit=max&auto=format&n=DW7SPQWol8VdzZS9&q=85&s=3172a8bdc78c10ad2567cf64e90ac23c" alt="Edit mode error footer with a detailed pop-up message identifying the script error location" width="674" height="310" data-path="gantt/images/48001268109/1.png" />
</Frame>

To access the browser console, right-click on the page, select **Inspect**, and go to the **Console** tab.

### In View Mode (User View)

A visual indicator (triangle icon in the Gantt footer) informs end users when configuration or data-related issues occur. The indicator shows a count badge with the number of errors detected.

<Frame>
  <img src="https://mintcdn.com/none-17b4493f/DW7SPQWol8VdzZS9/gantt/images/48001268109/2.png?fit=max&auto=format&n=DW7SPQWol8VdzZS9&q=85&s=af170aa95c23b353ff2cd63fad4e6bba" alt="View mode triangle warning icon in the Gantt footer alerting end users to a configuration or data issue" width="1792" height="738" data-path="gantt/images/48001268109/2.png" />
</Frame>

## Error Types

The Gantt distinguishes between three script error categories:

| Error Type           | Prefix in Error Panel   | Source                               |
| -------------------- | ----------------------- | ------------------------------------ |
| Config Script Error  | `Config Script Error:`  | Gantt Config Script widget parameter |
| Markers Script Error | `Markers Script Error:` | Markers Script widget parameter      |
| Item Script Error    | `Item Script Error:`    | Item Script widget parameter         |

<Steps>
  <Step title="Identify the Failing Script">
    1. Open the page in edit mode
    2. Look for the error indicator in the Gantt footer
    3. Click the indicator to see the detailed error list
    4. Note the error type prefix to determine which script is failing

    <Tip title="Server-side script errors are logged but do not crash the Gantt">
      Item scripts run on the server for each work item. If an item script contains an error, the error is logged but the Gantt continues to load. Items with script errors may display without the customizations the script was supposed to apply (e.g., missing colors).
    </Tip>
  </Step>

  <Step title="Check for Polarion 2304+ Compatibility">
    If your scripts stopped working after a Polarion upgrade to version 2304 or later, you need to update the script syntax:

    **Before (Polarion 2303 and earlier):**

    ```javascript theme={null}
    if (wi.status != null) {
        var statusId = wi.status.id;
    }
    ```

    **After (Polarion 2304+):**

    ```javascript theme={null}
    if (typeof wi !== 'undefined') {
        var statusId = wi.getStatus().getId();
    }
    ```

    Key changes:

    * Replace `null` checks with `typeof` checks (e.g., `typeof wi !== 'undefined'`)
    * Replace direct property access with getter methods (e.g., `wi.getStatus().getId()` instead of `wi.status.id`)

    <Warning title="Scripts break silently after Polarion 2304 upgrade">
      After upgrading Polarion to 2304+, existing item and plan scripts may fail with `undefined` variable errors. Visual elements like colors may stop loading. Update all scripts to use the new API syntax.
    </Warning>
  </Step>

  <Step title="Debug the Script">
    1. **Isolate the error** -- Temporarily clear the script content, save, and confirm the Gantt loads without errors
    2. **Re-add incrementally** -- Add the script back line by line to pinpoint the failing statement
    3. **Check variable availability** -- Item scripts have access to `task`, `wi` (work item), `plan`, `config`, `util`, and other context variables. Verify you are using the correct variable names.
    4. **Check browser console** -- Look for detailed JavaScript error messages including line numbers

    <Tip title="Update to version 24.5.3+ for script execution fixes">
      If item scripts are not executing at all (causing colors or other visual elements to not load), update to Gantt version 24.5.3 or later, which includes a fix for script execution issues.
    </Tip>
  </Step>

  <Step title="Validate and Save">
    After correcting the script:

    1. Save the page in the wiki editor
    2. Switch to view mode
    3. Verify the error indicator has disappeared from the Gantt footer
    4. Check that the script's intended behavior (colors, markers, custom logic) is applied correctly
  </Step>
</Steps>

## Verify

You should now see the Gantt chart loading without the error indicator in the footer. If you had script-driven colors, markers, or other customizations, they should now render correctly on all task bars.

## See also

* [Write Item Scripts](/gantt/guides/scripting/item-script-basics)
* [Write Gantt Config Scripts](/gantt/guides/scripting/gantt-config-script)
* [Debug Script Errors](/gantt/guides/scripting/debug-scripts)
* [Migrate Scripts for Polarion 2304+](/gantt/guides/scripting/script-migration-2304)

<LastReviewed date="2026-06-24" />
