New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

JavaScript console error Telerik is not defined

Environment

ProductTelerik UI for ASP.NET AJAX

Description

Found out the different reasons to get Telerik is not defined JavaScript error in your browser console

Error Message

  • Telerik is undefined
  • Uncaught ReferenceError: Telerik is not defined
  • Microsoft JScript runtime error: 'Telerik' is undefined
  • Uncaught ReferenceError: $telerik is not defined

Solution

To fix the above errors try the following tips:

  • Set CombineScripts="false" in the ASP.NET script manager
  • Disable the debugging in the web.config
XML
<compilation debug="false" targetFramework="4.8">
  • Disable the UnobtrusiveValidationMode in the web.config file
XML
<appSettings>
	<add key="ValidationSettings:UnobtrusiveValidationMode" value="None"/>
  • Remove the targetFramework attribute from the httpRuntime section of the web.config
XML
<httpRuntime requestLengthDiskThreshold="512" useFullyQualifiedRedirectUrl="true" executionTimeout="110" requestValidationMode="2.0"  maxRequestLength="102400" />
XML
<configuration>
	<location path="Telerik.Web.UI.WebResource.axd">
		<system.web>
			<authorization>
			<allow users="*"/>
			</authorization>
		</system.web>
	</location>
</configuration>
  • Enable or Disable the Telerik ScriptManager CDN
XML
<add key="Telerik.ScriptManager.TelerikCdn" value="Enabled" />
  • Proxy server, Firewall, WebSense or another security/authentication program could redirect and/or wipe out the contents of the Telerik script files, and therefore to cause the Telerik is not defined error. In such scenarios where the Script Response is empty in the Network tab of DevTools or you get a status code of 307, make sure that the Telerik CDN is disabled or set the following URLs to the allowed proxy list of URLS so that these resources pass through the proxy unmodified:

See Also