Is Vite supported?

0 Answers 11 Views
Grid
Hui Chuan
Top achievements
Rank 1
Hui Chuan asked on 25 Apr 2025, 06:20 AM

Module Bundlers - Kendo UI Third-Party Tools - Kendo UI for jQuery

The module bundlers page references Vite as an example which leads me to believe that it can be used with Kendo.

However even this basic example doesn't appear to work: https://stackblitz.com/edit/vitejs-vite-i842ucun?file=src%2Fmain.js

Am I doing something wrong?

Lee
Top achievements
Rank 1
commented on 25 Apr 2025, 07:48 PM

Hui are you getting the error: Uncaught ReferenceError: jQuery is not defined
Lee
Top achievements
Rank 1
commented on 25 Apr 2025, 07:49 PM

I am using vite also
Hui Chuan
Top achievements
Rank 1
commented on 28 Apr 2025, 10:14 AM

I used @rollup/plugin-inject to inject jQuery so instead the error is: Uncaught TypeError: Cannot read properties of undefined (reading 'jQuery')

Nikolay
Telerik team
commented on 29 Apr 2025, 09:24 AM

Hi Hui Chuan,

This error usually occurs when the jQuery library is not loaded before Kendo UI scripts, or if there's a conflict with the jQuery version. Here are some steps to resolve this issue:

1. Ensure your HTML file includes the jQuery script before the Kendo UI script:

<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2025.1.227/js/kendo.all.min.js"></script>

2. Ensure you are using a compatible version. Below, I am posting an article with the supported jQuery versions for each Kendo UI:

https://docs.telerik.com/kendo-ui/intro/supporting/jquery-support

3. Wrap your Kendo UI initialization code inside a $(document).ready() function to ensure it runs after the DOM is fully loaded:

$(document).ready(function() {
    // Kendo UI initialization code here
});

Regards,

Nikolay

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Hui Chuan
Top achievements
Rank 1
Share this question
or