Anyone know why I'm getting a javascript error saying: "Kendo file / is included more than once"? Sometimes it doesn't show this error, but most of the time it does. Below is my layout.cshtml. Any help would be greatly appreciated!
<!DOCTYPE html>
<html>
<head>
<title>@ViewBag.Title</title>
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/kendo/2017.1.223/kendo.common.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/kendo/2017.1.223/kendo.dataviz.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/kendo/2017.1.223/kendo.default.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/kendo/2017.1.223/kendo.dataviz.default.min.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/kendo/2017.1.223/jquery.min.js")"></script>
<script src="@Url.Content("~/Scripts/kendo/2017.1.223/jszip.min.js")"></script>
<script src="@Url.Content("~/Scripts/kendo/2017.1.223/kendo.all.min.js")"></script>
<script src="@Url.Content("~/Scripts/kendo/2017.1.223/kendo.aspnetmvc.min.js")"></script>
@RenderSection("HeadContent", false)
@*using the bundles instead*@
@*@Styles.Render("~/Content/test.css")*@
@Scripts.Render("~/bundles/bootstrap")
@Styles.Render("~/Content/css")
<script src="@Url.Content("~/Scripts/kendo.modernizr.custom.js")"></script>
</head>
<body>
<header>
</header>
<div id="body">
@RenderSection("featured", required: false)
<section class="content-wrapper main-content clear-fix">
@RenderBody()
</section>
</div>
<footer>
<div class="content-wrapper">
</div>
</footer>
</body>
</html>
<!--Reference the SignalR library. (after jquery references)-->
<script src="~/Scripts/jquery.signalR-2.2.0.min.js"></script>
<!--Reference the autogenerated SignalR hub script. -->
<script src="~/signalr/hubs"></script>
13 Answers, 1 is accepted
It seems like having the following scripts it causes this:
/Scripts/kendo/2017.1.223/kendo.all.min.js
/Scripts/kendo/2017.1.223/kendo.aspnetmvc.min.js
When I remove the reference to: "kendo.aspnetmvc.min.js" it doesn't throw this error. However, I need that reference because I am using mvc. Any ideas?
Hi,
I'm seeing the same error as Gregory was getting but am loading the .js files from the Telerik CDN so his solution isn't going to work for me.
Anyone got a suggestion ?
This is not a known issue and combining both script files should not be required.
This is how a regular scripts and style files references should look like when using the CDN:
<
link
href
=
"https://kendo.cdn.telerik.com/2017.2.504/styles/kendo.common-material.min.css"
rel
=
"stylesheet"
type
=
"text/css"
/>
<
link
href
=
"https://kendo.cdn.telerik.com/2017.2.504/styles/kendo.mobile.all.min.css"
rel
=
"stylesheet"
type
=
"text/css"
/>
<
link
href
=
"https://kendo.cdn.telerik.com/2017.2.504/styles/kendo.dataviz.min.css"
rel
=
"stylesheet"
type
=
"text/css"
/>
<
link
href
=
"https://kendo.cdn.telerik.com/2017.2.504/styles/kendo.material.min.css"
rel
=
"stylesheet"
type
=
"text/css"
/>
<
link
href
=
"https://kendo.cdn.telerik.com/2017.2.504/styles/kendo.dataviz.material.min.css"
rel
=
"stylesheet"
type
=
"text/css"
/>
<
script
src
=
"https://kendo.cdn.telerik.com/2017.2.504/js/jquery.min.js"
></
script
>
<
script
src
=
"https://kendo.cdn.telerik.com/2017.2.504/js/angular.min.js"
></
script
>
<
script
src
=
"https://kendo.cdn.telerik.com/2017.2.504/js/jszip.min.js"
></
script
>
<
script
src
=
"https://kendo.cdn.telerik.com/2017.2.504/js/kendo.all.min.js"
></
script
>
<
script
src
=
"https://kendo.cdn.telerik.com/2017.2.504/js/kendo.aspnetmvc.min.js"
></
script
>
<
script
src
=
"https://kendo.cdn.telerik.com/2017.2.504/js/pako_deflate.min.js"
></
script
>
Please check if there is another place where Kendo UI scripts are loaded.
If the issue still occurs, please send a runnable example reproducing the issue and I gladly assist.
Regards,
Stefan
Progress Telerik
i do have the kendo references properly defined. but i still i get this error
kendo.syncReady(function(){jQuery("#BudgetNegotiationGrid").kendoGrid({"dataBound":dataBound,"edit":edit,"columns":[{"title":"Proposal","headerAttributes":{"data-field":"ProposalID","data-title":"Proposal"},"width":"5px","field":"ProposalID","filterable":{"operators":{"string":{"startswith":"Starts with"}}},"encoded":true}],"pageable":{"refresh":true,"buttonCount":10},"sortable":true,"selectable":"Single, Row","filterable":{"extra":false,"operators":{"string":{"startswith":"Starts with"}}},"resizable":true,"scrollable":false,"messages":{"noRecords":"No records available."},"dataSource":{"type":(function(){if(kendo.data.transports['aspnetmvc-ajax']){return 'aspnetmvc-ajax';} else{throw new Error('The kendo.aspnetmvc.min.js script is not included.');}})(),"transport":{"read":{"url":"/BudgetNegotiation/BudgetNegotiation/Budget_Negotiation_Read"},"prefix":""},"pageSize":30,"page":1,"total":0,"serverPaging":true,"serverSorting":true,"serverFiltering":true,"serverGrouping":true,"serverAggregates":true,"filter":[],"schema":{"data":"Data","total":"Total","errors":"Errors","model":{"fields":{"ProposalID":{"type":"number"},"SiteID":{"type":"string"},"SiteName":{"type":"string"},"Address":{"type":"string"},"Grade":{"type":"string"},"SchoolDistrict":{"type":"number"},"RFP":{"type":"string"},"tblSitesID":{"type":"number"},"RFPType":{"type":"string"},"RFPYear":{"type":"string"},"FinalAward":{"type":"string"}}}}},"mobile":true});});
</script>
<link href="https://kendo.cdn.telerik.com/2019.1.220/styles/kendo.common-bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="https://kendo.cdn.telerik.com/2019.1.220/styles/kendo.mobile.all.min.css" rel="stylesheet" type="text/css" />
<link href="https://kendo.cdn.telerik.com/2019.1.220/styles/kendo.bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="https://kendo.cdn.telerik.com/2019.1.220/js/jquery.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2019.1.220/js/jszip.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2019.1.220/js/kendo.all.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2019.1.220/js/kendo.aspnetmvc.min.js"></script>
Such script errors can be observed when a script is missing or jQuery is referenced multiple times. Would you make sure that there is only one reference in the project and see how the behavior changes?
In case the errors persist please send us a runnable sample where the behavior is replicated. This will enable us to examine it and look for what is causing the issue.
Regards,
Viktor Tachev
Progress Telerik
I'm having the exact same issue, the fix for me is a custom bundle. If i remove the kendo.aspnetmvc.min.js the error goes away but then a get the kendo.syncready is not a function error which is due to missing aspnetmvc file.
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2019.1.220/js/kendo.all.min.js?t=04132019"></script>
<script src="https://kendo.cdn.telerik.com/2019.1.220/js/kendo.aspnetmvc.min.js?t=04132019"></script>
Please make sure that Kendo files are not referenced somewhere else in the application. If that is the case remove the extra references and leave only one.
If the behavior persists, would you send us a runnable project where the error is observed so we can examine it?
Regards,
Viktor Tachev
Progress Telerik
Viktor -
Would including the kendo.mvc.dll cause this issue to occur? I've searched high and low and can't find any additional references outside of the 2 i posted (kendo.all and the kendo aspmvc js file).
If there is no reference to Kendo.Mvc.dll you would not be able to use the Kendo HtmlHelpers and there should be an error shown in Visual Studio.
In case you are working on a MVC application and would like to use the MVC wrappers make sure that Kendo.Mvc.dll is referenced in the project.
If the error persists please send us a runnable project where the issue can be replicated so we can examine it.
Regards,
Viktor Tachev
Progress Telerik