Error Reference

Script Include not found: unable to instantiate class

Script Include not found: unable to instantiate class

Where this appears

This error appears in browser console logs, system application logs, or script debugger when attempting to instantiate a Script Include using the new operator or calling a static method. The error typically occurs during server-side script execution in Business Rules, Script Actions, or other server-side scripts.

Sourdough
Chrome Extension

Debugging this in a real instance?

Sourdough lets you trace "Script Include not found: unable to instantiate class" through system logs, script errors, and API health in the ServiceNow tab you are already using.

Add to Chrome

Free to install. Pro $5/month after a 14-day no-card trial.
Pro requires the ServiceNow admin role. Upgrade inside the extension.

Overview
Tasks
CMDB
API
Metrics
Monitor
Internals
Instance:sourdoughdev·Version:Yokohama
Instance StateONLINE
System StatusFully Operational
Session Timeout90 minutes
Logged-In Sessions2 (20 active)
Build Nameyokohama-12-18-2024_p1
IP Address10.159.128.43
Instance HealthHealth Score: 90%
🔥 5dSourdough (Chrome Plugin)Dark Mode

Cause

The Script Include record does not exist in the database or has been deleted from the sys_script_include table. (high likelihood)

The Script Include is inactive (Active field is false) or the application it belongs to is inactive. (high likelihood)

The Script Include exists in a different application scope and cross-scope access is not properly configured or the calling script lacks permission. (medium likelihood)

The Script Include name in the code does not match the exact Name field value in the Script Include record, including case sensitivity. (medium likelihood)

The Script Include has syntax errors or compilation issues preventing it from being loaded into the server-side JavaScript environment. (low likelihood)

Fix

Step 1: Navigate to System Definition > Script Includes and search for the Script Include name referenced in your code to verify it exists.

Step 2: Check that the Script Include record has the Active field set to true and verify the application it belongs to is also active.

Step 3: Compare the exact Script Include Name field value with the class name used in your instantiation code, ensuring case-sensitive match.

Step 4: If the Script Include is in a different scope, navigate to System Applications > Studio and verify cross-scope access is configured in the Application Access tab.

Step 5: Open the Script Include record and check for syntax errors by clicking the Syntax Check button or reviewing the Script field for compilation issues.

Step 6: Check the System Log at System Diagnostics > Logs > App Logs > All for any related error messages during Script Include loading.

Step 7: Test the Script Include instantiation in a Background Script (System Definition > Scripts - Background) to isolate the issue.

Step 8: If the Script Include was recently created or modified, clear the instance cache by restarting the instance or using the Cache.flush() method in a Background Script.

Test Your Knowledge

Quick 3-question quiz. See how your ServiceNow skills stack up.

Question 1 of 3Performance

A list view on a table with millions of records is slow. Best fix?

Select an answer to continue