NullReferenceException when using latest version (2024.1.130) of kendo.custom.min.js

0 Answers 242 Views
Application
AGGELIKI
Top achievements
Rank 1
Iron
AGGELIKI asked on 29 Feb 2024, 04:50 PM

From https://www.telerik.com/download/custom-download# I tried to download the latest version 2024.1.130 kendo.custom.min.js file in order to upgrade the kendo plugin  from Kendo UI 2022.1.412 version to the latest. 
I use Asp.Net MVC and I have a custom bundler where I reference all the js files like this

 bundles.Add(new ScriptBundle("~/bundle/kendo").Include( "~/Scripts/kendo/kendo.custom.min.js"));   

Then in Razor Layout page I register bundles like this

@Scripts.Render("~/bundle/kendo")

but whenever I run the application I always get a NullReferenceException at the line that registers the bundle with the message "No object reference is set to an object instance."

Whenever I downgrade the kendo version or return to the previous one the application runs properly.

Any ideas why is this happening? Would you please help me solve this issue? 

Thanx in Advance.

Anton Mironov
Telerik team
commented on 05 Mar 2024, 11:29 AM

Hi Aggeliki,

 

Thank you for the details provided. As this is a duplicate of the ticket 1643534 opened in our system, I am pasting my reply here as well. Please keep the communication in one place.

As this is a minified script file, I am not able to debug it, but it will be great if you could share the complete scenario.

Please let me know which components are checked in preparing the file and if the helpers are checked as well.

I will then repeat the flow on my side and will be able to replicate the same behavior on my side.

Looking forward to hearing back from you.

Kind Regards,
Anton Mironov
Christian
Top achievements
Rank 1
commented on 01 Nov 2024, 10:34 AM

Hey,

i got the same error after update to the latest kendo ui (mvc) version 2024.3.1015 on bundling javascript files.

Is there any solution or is the problem known?

Layout
@Scripts.Render("~/bundles/kendo")
Bundle Config
bundles.Add(new ScriptBundle("~/bundles/kendo")
    .Include("~/Scripts/kendo/" + kendoVersion + "/kendo.web.min.js")                
    .Include("~/Scripts/kendo/" + kendoVersion + "/kendo.dataviz.core.min.js")                
    .Include("~/Scripts/kendo/" + kendoVersion + "/kendo.dataviz.qrcode.min.js")                
    .Include("~/Scripts/kendo/" + kendoVersion + "/kendo.aspnetmvc.min.js")
    //.Include("~/Scripts/kendo/" + kendoVersion + "/jszip.min.js")
    .Include("~/Scripts/jszip/jszip.min.js")
    .Include("~/Scripts/kendo/" + kendoVersion + "/messages/kendo.messages.de-DE.min.js")
    .Include("~/Scripts/kendo/" + kendoVersion + "/cultures/kendo.culture.de-DE.min.js")                
);

System.NullReferenceException
  HResult=0x80004003
  Nachricht = Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
  Quelle = WebGrease
  Stapelüberwachung:
   bei Microsoft.Ajax.Utilities.JSParser.ParseExpression(AstNode leftHandSide, Boolean single, Boolean bCanAssign, JSToken inToken)
   bei Microsoft.Ajax.Utilities.JSParser.ParseExpression(AstNode leftHandSide, Boolean single, Boolean bCanAssign, JSToken inToken)
   bei Microsoft.Ajax.Utilities.JSParser.ParseObjectLiteralProperty(Boolean isBindingPattern)
   bei Microsoft.Ajax.Utilities.JSParser.ParseObjectLiteral(Boolean isBindingPattern)
   bei Microsoft.Ajax.Utilities.JSParser.ParseLeftHandSideExpression(Boolean isMinus)
   bei Microsoft.Ajax.Utilities.JSParser.ParseUnaryExpression(Boolean& isLeftHandSideExpr, Boolean isMinus)
   bei Microsoft.Ajax.Utilities.JSParser.ParseExpressionList(JSToken terminator)
   bei Microsoft.Ajax.Utilities.JSParser.ParseMemberExpression(AstNode expression, List`1 newContexts)
   bei Microsoft.Ajax.Utilities.JSParser.ParseLeftHandSideExpression(Boolean isMinus)
   bei Microsoft.Ajax.Utilities.JSParser.ParseUnaryExpression(Boolean& isLeftHandSideExpr, Boolean isMinus)
   bei Microsoft.Ajax.Utilities.JSParser.ParseExpressionStatement(Boolean fSourceElement)
   bei Microsoft.Ajax.Utilities.JSParser.ParseStatement(Boolean fSourceElement, Boolean skipImportantComment)
   bei Microsoft.Ajax.Utilities.JSParser.ParseFunctionBody(Block body)
   bei Microsoft.Ajax.Utilities.JSParser.ParseFunction(FunctionType functionType, Context fncCtx)
   bei Microsoft.Ajax.Utilities.JSParser.ParseLeftHandSideExpression(Boolean isMinus)
   bei Microsoft.Ajax.Utilities.JSParser.ParseUnaryExpression(Boolean& isLeftHandSideExpr, Boolean isMinus)
   bei Microsoft.Ajax.Utilities.JSParser.ParseObjectLiteralProperty(Boolean isBindingPattern)
   bei Microsoft.Ajax.Utilities.JSParser.ParseObjectLiteral(Boolean isBindingPattern)
   bei Microsoft.Ajax.Utilities.JSParser.ParseLeftHandSideExpression(Boolean isMinus)
   bei Microsoft.Ajax.Utilities.JSParser.ParseUnaryExpression(Boolean& isLeftHandSideExpr, Boolean isMinus)
   bei Microsoft.Ajax.Utilities.JSParser.ParseExpressionList(JSToken terminator)
   bei Microsoft.Ajax.Utilities.JSParser.ParseMemberExpression(AstNode expression, List`1 newContexts)
   bei Microsoft.Ajax.Utilities.JSParser.ParseLeftHandSideExpression(Boolean isMinus)
   bei Microsoft.Ajax.Utilities.JSParser.ParseUnaryExpression(Boolean& isLeftHandSideExpr, Boolean isMinus)
   bei Microsoft.Ajax.Utilities.JSParser.ParseVarDecl(JSToken inToken)
   bei Microsoft.Ajax.Utilities.JSParser.ParseVariableStatement()
   bei Microsoft.Ajax.Utilities.JSParser.ParseFunctionBody(Block body)
   bei Microsoft.Ajax.Utilities.JSParser.ParseFunction(FunctionType functionType, Context fncCtx)
   bei Microsoft.Ajax.Utilities.JSParser.ParseLeftHandSideExpression(Boolean isMinus)
   bei Microsoft.Ajax.Utilities.JSParser.ParseUnaryExpression(Boolean& isLeftHandSideExpr, Boolean isMinus)
   bei Microsoft.Ajax.Utilities.JSParser.ParseExpression(AstNode leftHandSide, Boolean single, Boolean bCanAssign, JSToken inToken)
   bei Microsoft.Ajax.Utilities.JSParser.ParseExpressionStatement(Boolean fSourceElement)
   bei Microsoft.Ajax.Utilities.JSParser.ParseStatement(Boolean fSourceElement, Boolean skipImportantComment)
   bei Microsoft.Ajax.Utilities.JSParser.ParseStatements(Block block)
   bei Microsoft.Ajax.Utilities.JSParser.InternalParse()
   bei Microsoft.Ajax.Utilities.Minifier.MinifyJavaScript(String source, CodeSettings codeSettings)
   bei System.Web.Optimization.JsMinify.Process(BundleContext context, BundleResponse response)
   bei System.Web.Optimization.Bundle.ApplyTransforms(BundleContext context, String bundleContent, IEnumerable`1 bundleFiles)
   bei System.Web.Optimization.Bundle.GetBundleResponse(BundleContext context)
   bei System.Web.Optimization.BundleResolver.GetBundleContents(String virtualPath)
   bei System.Web.Optimization.AssetManager.DeterminePathsToRender(IEnumerable`1 assets)
   bei System.Web.Optimization.AssetManager.RenderExplicit(String tagFormat, String[] paths)
   bei ASP._Page_Views_Account__LayoutLogin_cshtml.Execute() in c:\Users\Luettig\source\repos\mmv-vpp-git - alt workspace\mmvln\Views\Account\_LayoutLogin.cshtml: Zeile40

  Diese Ausnahme wurde ursprünglich von dieser Aufrufliste ausgelöst:
    [Externer Code]
    ASP._Page_Views_Account__LayoutLogin_cshtml.Execute() in _LayoutLogin.cshtml

Anton Mironov
Telerik team
commented on 06 Nov 2024, 08:25 AM

Hi Christian,

In order to resolve the pointed issue, I would recommend:

  • Use the CDN scripts in the _Layout file and let me know if the issue is resolved. Here is an example of the head content:
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>@ViewBag.Title - My Telerik MVC Application</title>
        <link href="https://kendo.cdn.telerik.com/themes/7.0.2/default/default-ocean-blue.css" rel="stylesheet" type="text/css" />
        <link href="@Url.Content("~/Content/bootstrap.min.css")" rel="stylesheet" type="text/css" />
        <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
        <script src="@Url.Content("~/Scripts/bootstrap.min.js")"></script>
        <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
        <script src="https://cdn.kendostatic.com/2024.1.130/js/jszip.min.js"></script>
        <script src="https://cdn.kendostatic.com/2024.1.130/js/kendo.all.min.js"></script>
        <script src="https://cdn.kendostatic.com/2024.1.130/js/kendo.aspnetmvc.min.js"></script>
    </head>
  • Send me a sample of your application with your bundle file registered and added. I will invest further time in trying to resolve the current behavior.

 

Best Regards,
Anton Mironov

No answers yet. Maybe you can help?

Tags
Application
Asked by
AGGELIKI
Top achievements
Rank 1
Iron
Share this question
or