AWS Cloud Discovery fails with "undefined is not a function" error in pattern due to missing MID server script includesIssue AWS Cloud Discovery fails during the Amazon AWS Service account pattern execution with the error: undefined is not a function.MID Server logs show "Class" is not defined due to missing script includes.SymptomsAWS Cloud Discovery fails during the Amazon AWS Service account pattern execution. Step 16 – Fetch account id for current creds shows the following error: Exception occurred while executing operation Cloud REST Query. Custom operation failed to run script due to the following error: JAVASCRIPT_CODE_FAILURE: undefined is not a function. MID Server logs contain: com.service_now.mid.script.MIDEcmaError: "Class" is not defined. ReleaseAny releaseCauseThe issue occurred because essential MID Server Script Includes (Class, PrototypeServer, and String) were missing from the instance. This can cause due to bad clone, where Discovery and MID-related tables were not excluded from the clone, leading to script execution failures during pattern runtime due to missing MID script include files.ResolutionTo resolve the issue: Verify that the following MID Server Script Includes are present in the instance: Class,PrototypeServer,String https://<instance_name>.service-now.com/ecc_agent_script_include_list.do?sysparm_query=name%3Dclass%5EORname%3DPrototypeServer%5EORname%3DString&sysparm_view=discovery If any script includes are missing, import them from a working instance using Update Sets or XML files. After import, re-run the AWS Cloud Discovery to validate that the Amazon AWS Service account pattern executes successfully.