cancel
Showing results for 
Search instead for 
Did you mean: 

Library is not coming from Accept CDN.

Hey. A client has reached out to me with the following error message:

Please include Accept.js library from cdn.

And in the console:

Library is not coming from Accept CDN.

However the library is coming from the CDN. I have been unable to reproduce the error without actually loading it from somewhere else. The client has already tried clearing the browser cache. What else could be causing this issue?

 

Thank you.

tan
Contributor
16 REPLIES 16

Hey. I discovered what the problem is. The client appears to have a plugin on their website that is adding a query argument "?ver=4.5.7" to the end of every script tag "src". This is presumably for cache control purposes. Now that I know what the problem is, I can work on a solution.

 

Thank you very much to everyone who helped.

Oh wow. That's great that you found it, and thanks immensely for coming back with the update. Now that's something we can remember to check if we here any other report. I don't know how common this method of cache control would be, so I don't know if it's worth our while to investigate any accomodations on our end. We could, for example, only attempt to match the URL up to any query string given.

 

In the short term, we could possibly put something in the documentation that says we verify where the script was loaded from, and we do that by actually comparing the URL string against what we know to be correct, so don't do anything that might break that.

 

Again, thanks!

Hey. Sorry, I was mistaken. It's actually WordPress adding the query argument, not a plugin.

Hello,

 

I am seeing the same problem on my end.

The jquery is automatically adding ?=timestamp to https://jstest.authorize.net/v1/Accept.js which I fixed by temporarily disabling cache while loading the Accept.js script.

 

However,  I now see the error on the AcceptCore.js.  I can confirm that the dynamic ?=[timestamp] is no longer sent, but still I am getting 90:97 Library is not coming from Accept CDN.

 

https://jstest.authorize.net/v1/AcceptCore.js

 

0 !== document.querySelectorAll('script[src="' + c + '"]').length || k(z, b) || (y.warn("Library is not coming from Accept CDN."), m(b, C.messageInfo.E_WC_01)), "https:" === window.location.protocol || k(z, a) || (y.warn("An HTTPs connection is required to secure delivery of payment information."), m(a, C.messageInfo.E_WC_02))

Did anybody encounter this, how do I fix this ?

 

Any help is highly appreciated.

 

Thank you.

Hello,

 

I am seeing the same problem on my end.

The jquery is automatically adding ?=timestamp to https://jstest.authorize.net/v1/Accept.js which I fixed by temporarily disabling cache while loading the Accept.js script.

 

However, I now see the error on the AcceptCore.js. I can confirm that the dynamic ?=[timestamp] is no longer sent, but still I am getting 90:97 Library is not coming from Accept CDN.

 

https://jstest.authorize.net/v1/AcceptCore.js

 

0 !== document.querySelectorAll('script[src="' + c + '"]').length || k(z, b) || (y.warn("Library is not coming from Accept CDN."), m(b, C.messageInfo.E_WC_01)), "https:" === window.location.protocol || k(z, a) || (y.warn("An HTTPs connection is required to secure delivery of payment information."), m(a, C.messageInfo.E_WC_02))

Did anybody encounter this, how do I fix this ?

 

Any help is highly appreciated.

 

Thank you.

Any update/resolution to the issue I posted ?

I just ran into this issue on a Wordpress site, it's because Wordpress automatically adds a query string to the end of js and css files. In this particular instance it was still adding them despite having nulled the version number when enqueue'ing the script. 

 

I had to use this code snippet to remove the query string from only Accept.js and fix the issue.

 

// remove version from scripts and styles
function remove_version_scripts_styles($src) {
    if (strpos($src, 'Accept.js')) {        $src = remove_query_arg('ver', $src);
    }
    return $src;
}add_filter('script_loader_src', 'remove_version_scripts_styles', 9999);

 

I think it's a little ridiculous that a query string could break the whole thing, but this did the trick.