Serenity
Serenity

Reputation: 121

"Jquery is undefined" while migrating from jquery 1.12.4 to 3.5.1

I'm working on upgrading a web-app that uses jquery-1.9.1, jquery-ui-1.10.3, runs on a JBoss AS 7.0 server and uses Internet Explorer-11. I need to upgrade jquery to the latest version, which is jquery-3.5.1 currently.

Following the steps mentioned in this upgrade guide, I first upgraded to the latest jquery 1.x (1.12.4) version using jquery-migrate-1.4.1 (there were no warnings/errors in the console and upon removing the jquery-migrate-1.4.1 import the app ran successfully).

So now I'm trying to upgrade jquery-1.12.4 to 3.5.1 using the jquery-migrate-3.3.0 plugin. I've replaced all <script type="text/javascript" src="js/jquery-1.12.4.js"></script> tags with :

<script type="text/javascript" src="js/jquery-3.5.1.js"></script>
<script type="text/javascript" src="js/jquery-migrate-3.3.0.js"></script>

On running the app, the webpage does not load and I see the following errors in the browser's console :

SCRIPT1010: Expected identifier
jquery-3.5.1.js (4073,4)

SCRIPT5009: 'jQuery' is undefined
jquery-migrate-3.3.0.js (22,3)

SCRIPT5009: 'jQuery' is undefined
jquery-ui.js (5,1)

These errors are in the jquery files that I downloaded from the official website : https://code.jquery.com/jquery/ , and I have not edited these files myself.

I have no idea why these errors are occurring.

Also, side question, do I also have to upgrade jquery-ui-1.10.3 to the latest jquery-ui version in order to upgrade jquery? I prefer to only upgrade jquery, if possible.

Upvotes: 2

Views: 3486

Answers (1)

user21093366
user21093366

Reputation: 1

I think between the two migration script you need to install the version 3.0.0 of jQuery.

Source:https://www.youtube.com/watch?v=8LR3xgCz1Wo

Upvotes: 0

Related Questions