JQuery Is Not Defined

2 Answers 1095 Views
General Discussions
Yunier
Top achievements
Rank 1
Yunier asked on 22 Dec 2022, 03:54 PM

Hello, 

I recently upgrade my Angular project to Angular 15.

My project uses Kendo-UI for Angular, version 2022.3.1109. I can build the Angular project successfully, however, at runtime I get the following error.

Uncaught ReferenceError: jQuery is not defined
    at Object.<anonymous> (main.js:1:289462)
    at 56426 (main.js:1:4601988)
    at r (runtime.js:1:143)
    at 51403 (main.js:1:207525)
    at r (runtime.js:1:143)
    at Ln (main.js:1:6260043)
    at main.js:1:6260064
    at n (runtime.js:1:2659)
    at main.js:1:69

I have no direct reference to JQuery in my Angular project. 

I was able to trace the problem to the following lines of code.

Which comes from kendo.router.js

Could someone help me understand the problem, it seems like there is an issue with Kendo-UI for Angular, version 2022.3.1109, JQuery is not being properly defined.

By the way, I also attempted to follow the guide Kendo UI for jQuery Integration. Same result.

Any help/tips are appreciated.

Thank you.

 

Yunier
Top achievements
Rank 1
commented on 19 Jan 2023, 08:43 PM

Upgrading to the latest version, 2023.1.117, did not help, same error. 

 

Yanmario
Telerik team
commented on 26 Jan 2023, 10:47 AM

Hi Yunier,

I will need some time to consult our Kendo UI for jQuery developer team and will update you on this matter.

Regards,
Yanmario
Progress Telerik     

2 Answers, 1 is accepted

Sort by
0
Yanmario
Telerik team
answered on 27 Dec 2022, 07:16 AM

Hi Yunier,

Thank you for the provided details.

The issue is related to a specific version of jQuery that had problems with Webpack 4:

https://github.com/telerik/kendo-ui-core/issues/7012

This was fixed and will be ready for release in R1 2023. Feel free to update your jQuery version when it releases.

I hope this helps.

Regards,
Yanmario
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Yunier
Top achievements
Rank 1
commented on 29 Dec 2022, 12:17 AM

Thank you. 

I'm not familiar with Telerik's release schedule, when you say R1 2023, what does that mean?

 

Yanmario
Telerik team
commented on 29 Dec 2022, 07:40 AM

Hi Yunier,

Release 1 is expected on the 18th of January 2023 and more detailed information can be found in the following blog post:

https://www.telerik.com/blogs/just-announced-telerik-kendo-ui-r1-2023-release-webinars

Kendo UI for jQuery release history:

https://www.telerik.com/support/whats-new/kendo-ui/release-history

Also can be tracked in our public GitHub repository for jQuery - https://github.com/telerik/kendo-ui-core/milestone/103

I hope this information is helpful.

Regards,
Yanmario
Progress Telerik     

Yunier
Top achievements
Rank 1
commented on 29 Dec 2022, 01:00 PM

This information was helpful.

Thank you.

0
Yanmario
Telerik team
answered on 26 Jan 2023, 11:15 AM

Hi Yunier,

After dining into the error, I found out that the jquery.min.js has to be included inside angular.json scripts collection:

"architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist/a15-jq",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": [
              "zone.js"
            ],
            "tsConfig": "tsconfig.app.json",
            "assets": [
              "src/favicon.ico",
              "src/assets"
            ],
            "styles": [
              "src/styles.css"
            ],
            "scripts": ["node_modules/jquery/dist/jquery.min.js"]
          },

I will also attach a runnable Angular 15 application with Kendo UI for jQuery DatePicker widget.

I hope this resolves the issue on your side.

Regards,
Yanmario
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Yunier
Top achievements
Rank 1
commented on 26 Jan 2023, 08:56 PM

This was the solution, thank you so much.
Tags
General Discussions
Asked by
Yunier
Top achievements
Rank 1
Answers by
Yanmario
Telerik team
Share this question
or