Lots of warnings with jQuery migrate
KendallB
Posted on
Feb 12 2019
We are using jQuery migrate and raygun.js for reporting JS errors always trips it up. Is it possible to somehow have raygun.js know when we have jQuery migrate installed so I can turn off all the noise it generates? I need to see what stuff we need to migrate over, and I assume raygun.js does not depend on a specific version of jQuery?
We are using jQuery 3.3.x and jQuery Migrate 3.0.x.
Benjamin
Raygun
Posted on
Feb 12 2019
Hi KendallB,
Thanks for getting in touch. Raygun4JS itself does not depend on jQuery to run but if jQuery has been included we do attach events using jQuery to report ajax and event handler issues. It could be that the way we hook into those events generate the warnings you describe with jQuery Migrate.
Currently we do not detect if jQuery migrate is included or not to turn off the noise but I'll raise it with the team and we will investigate this issue.
Thanks
KendallB
Posted on
Feb 12 2019
Right, the issue is the methods used by your code to connect with jQuery are the older, legacy and deprecated methods (which probably won't work correctly in jQuery 3?). So maybe it needs to be updated to detect the jQuery version somehow and then use the newer methods rather than the older ones.
I know your single script has to support all the different ones in the field, so it is probably a bit of work to do that, but we do want it to hook into the jQuery error handling as necessary.
william.buchanan
Posted on
Sep 17 2020
This is still happening and is quite annoying. Are there any plans to upgrade this?
Benjamin
Raygun
Posted on
Sep 17 2020
Hi William,
Thanks for the letting us know. We are planning on a releasing a new version of the provider shortly so I'll have a look into what we can do to help resolve this at the same time.
I'll be in touch over the next few days and let you know how we get on.
Thanks,
william.buchanan
Posted on
Sep 18 2020
Thanks. At the moment the only reason we need jquery migrate is because of raygun so I really want to be able to get rid of it.
Benjamin
Raygun
Posted on
Sep 18 2020
Hi William,
Thanks for the additional context.
I tried installed jQuery 3.x.x with jQuery Migrate 3.x.x. but did not receive any warnings/issues as was being described.
Not to rule out an issue, it could be something that I'm doing. But if you could get in touch with tech support and provide some additional information I'll be happy to look into further.
Thanks, Ben
william.buchanan
Posted on
Sep 18 2020
Strange. You should see a bunch of jquery migrate warnings in the console. Not sure if you have to do something to enable them.
Mattybat
Posted on
Aug 16 2024
Hi, I'm also receiving a single warning in the browser console.
JQMIGRATE: jQuery.isFunction() is deprecated
I'm using:
- raygun4js 3.1.0
- jQuery v3.7.1
- jQuery Migrate - v3.4.1
See: https://api.jquery.com/jQuery.isFunction/ As of jQuery 3.3, jQuery.isFunction() has been deprecated. In most cases, its use can be replaced by typeof x === "function".
The line in issue is 4033, the one containing "$.isFunction" in https://cdn.raygun.io/raygun4js/raygun.js
if ($.isFunction(options[key])) {
options[key] = TraceKit.wrap(options[key]);
}
Normally I would ignore it, but I'm redirecting my JQMIGRATE console messages when in the development environment and displaying them in the browser using Alertify. So is a little annoying at the moment when I include raygun4js.
Any help would be appreciated.
Jared
Raygun
Posted on
Aug 16 2024
Hi Mattybat,
Thank you for bringing this up and providing some additional context. The team will look into updating the provider to resolve the deprecation warning for you next week.
Cheers, Jared
Jared
Raygun
Posted on
Aug 20 2024
Hi Mattybat,
I apologize for the delay. We will transition to the new syntax. Can you please change your fetch script's CDN URI from
"//cdn.raygun.io/raygun4js/raygun.min.js"
to
"//cdn.raygun.io/raygun4js/prerelease/raygun.min.js"
And confirm that the warnings are resolved for you?
Thank you,
Jared
Mattybat
Posted on
Aug 20 2024
Thanks for that.
I tested with the production version first to confirm the warning was still showing, then again with the prerelease version and the warning was gone.
So happy that the change is working for me.
The screenshot shows two requests with "JQMIGRATE: jQuery.isFunction() is deprecated" then another couple of requests where the warning is not there. Ignore the Google Maps messages.
Jared
Raygun
Posted on
Aug 20 2024
Great, I'm glad that warning can be resolved for you! I will let you know when the change is out of the prerelease stage, at which point you should return to "//cdn.raygun.io/raygun4js/raygun.min.js"
. In the meantime, you may stay on the prerelease.
Cheers, Jared
Jared
Raygun
Posted on
Aug 20 2024
Hi Mattybat,
The patch is now out of the prerelease phase. You should now return to fetching the script from "//cdn.raygun.io/raygun4js/raygun.min.js"
.
Thank you for raising this.