This is a migrated thread and some comments may be shown as answers.

Kendo UI Pro, Cannot read property 'extend' of undefined

3 Answers 1542 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Anthony
Top achievements
Rank 1
Anthony asked on 08 Oct 2015, 01:27 PM

Hi,

 My web application uses Webpack and has been working great with Kendo UI (FREE.) This afternoon I pulled a copy of Kendo UI PRO (version: 2015.3.1005) from the private repository using bower and attempted to require("kendo-ui").

 The project builds successfully with Webpack but unfortunately on loading the web application it registers the following error in the console:

 "Uncaught TypeError: Cannot read property 'extend' of undefined"

 I've narrowed down the error to the kendo.editor.min.js, individually adding ALL other component references and excluding editor works as expected. Inclusion of kendo.editor.min.js breaks the project.

The function call involved seems to be:

function(){!function(e,t){var n,i,r=window.kendo,o=r.ui.editor,a=o.Dom,s=e.extend,l="xx-small,x-small,small,medium,large,x-large,xx-large".split(",")....

3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 12 Oct 2015, 08:56 AM
Hello Trevor,

The observed error occurs if the kendo.editor.min.js file is registered before jQuery and/or before other Kendo UI scripts, which it relies on. Please check the following documentation page for details.

http://docs.telerik.com/kendo-ui/intro/supporting/scripts-general

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
1
Anthony
Top achievements
Rank 1
answered on 12 Oct 2015, 10:01 AM

Hi Dimo,

 Thank you for your reply.

 You pointed me in the right direction.

 In case someone else runs into this when using webpack and kendo pro. Even though I configured the ProvidePlugin I still had to ensure that Jquery is correctly: 

//webpack.config.js
 
new webpack.ProvidePlugin({
        $: "jquery",
        jQuery: "jquery",
        pubsub: "pubsub-js"
    })
 
//main.js
 
var $ = require('jquery');
window.jQuery = $;
window.$ = $;
 
require("bootstrap");
 
require("../bower_components/kendo-ui/js/kendo.all.min.js");

0
mehmet
Top achievements
Rank 1
answered on 30 Apr 2020, 11:23 AM
Thank you for sharing the code. It helped me.
Tags
General Discussions
Asked by
Anthony
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Anthony
Top achievements
Rank 1
mehmet
Top achievements
Rank 1
Share this question
or