RE: Version 9 - Script error on leads
Create a new solution, add the Lead entity with just the Lead Main form, export the solution unmanaged, then edit manually the customization.xml file, adding the reference to the script that generates the error. The reference should be added in the internalresources section and the end result should look like this:
<internalresources>
<clientincludes>
<internaljscriptfile src="$webresource:LeadManagement/Lead/Lead_main_system_library.js" />
<internaljscriptfile src="$webresource:MarketingSales/Lead/Lead_main_system_library.js" />
</clientincludes>
</internalresources>
Bring back the manually modified customization.xml into the solution and import it in. The error should be gone.