Title: Undefined error
Last modified: October 24, 2025

---

# Undefined error

 *  Resolved [stevygee1987](https://wordpress.org/support/users/stevygee1987/)
 * (@stevygee1987)
 * [7 months, 2 weeks ago](https://wordpress.org/support/topic/undefined-error-17/)
 * Today, I got a report from a client that PayPal payment stopped working. The 
   last successful payment using PayPal was 19 hours ago.
 * The error notice: `Cannot read properties of undefined (reading 'hasQueryArg')`
   
   In the browser console on the product page, I’m getting `Uncaught ReferenceError:
   paypal is not defined at l.value (class-product-gateway.js:71:26)`
 * WooCommerce version: 10.2.2
   Payment Plugin version: 1.1.14
    -  This topic was modified 7 months, 2 weeks ago by [stevygee1987](https://wordpress.org/support/users/stevygee1987/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fundefined-error-17%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Clayton R](https://wordpress.org/support/users/mrclayton/)
 * (@mrclayton)
 * [7 months, 2 weeks ago](https://wordpress.org/support/topic/undefined-error-17/#post-18694450)
 * Hi [@stevygee1987](https://wordpress.org/support/users/stevygee1987/)
 * Thank you for contacting Payment Plugins. You will notice that the last update
   of the plugin was released 3 weeks ago so you can rule the plugin out as being
   the cause of the issue.
 * The error you’re describing is usually caused by a caching issue. The `hasQueryArg`
   function is a core WordPress function in the `@wordpress/url` library. I can 
   see that the library is loading because it’s available at `window.wp.url.hasQueryArg`
   however it’s not available in your cached scripts.
 * It appears that something in your cache settings has changed which is resulting
   in the observed behavior.
 * Kind Regards
 *  Thread Starter [stevygee1987](https://wordpress.org/support/users/stevygee1987/)
 * (@stevygee1987)
 * [7 months, 1 week ago](https://wordpress.org/support/topic/undefined-error-17/#post-18697102)
 * Thanks for taking a look!
 * It was indeed a caching issue, or rather my WP Rocket settings. I’ve disabled“
   Delay JavaScript execution” completely and added the following lines to the exclusions
   for “Load JavaScript deferred”, which solved the issue:
 * `www.paypal.com
   wp-content/plugins/pymntpl-paypal-woocommerce/build/js/(.*).jswp-
   content/plugins/pymntpl-paypal-woocommerce/build/legacy/(.*).js

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Undefined error’ is closed to new replies.

 * ![](https://ps.w.org/pymntpl-paypal-woocommerce/assets/icon-256x256.png?rev=2718338)
 * [Payment Plugins for PayPal WooCommerce](https://wordpress.org/plugins/pymntpl-paypal-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pymntpl-paypal-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pymntpl-paypal-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/pymntpl-paypal-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pymntpl-paypal-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pymntpl-paypal-woocommerce/reviews/)

## Tags

 * [caching](https://wordpress.org/support/topic-tag/caching/)
 * [WP Rocket](https://wordpress.org/support/topic-tag/wp-rocket/)

 * 2 replies
 * 2 participants
 * Last reply from: [stevygee1987](https://wordpress.org/support/users/stevygee1987/)
 * Last activity: [7 months, 1 week ago](https://wordpress.org/support/topic/undefined-error-17/#post-18697102)
 * Status: resolved