Support » Plugin: WooPayments - Fully Integrated Solution Built and Supported by Woo » Error message in tos.js
Error message in tos.js
-
Getting this error when using the WP customizer, it appears to be comping from WooCommerce Payments:
<script src=’https://www.mydomain.com/wp-content/plugins/woocommerce-payments/dist/tos.js?ver=5.1.2′ id=’WCPAY_TOS-js’></script>
tos.js?ver=5.1.2:1 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'isEnabled') at et (tos.js?ver=5.1.2:1:46977) at ot (tos.js?ver=5.1.2:1:48855) at tos.js?ver=5.1.2:1:52477 at tos.js?ver=5.1.2:1:52927 at tos.js?ver=5.1.2:1:52930 et @ tos.js?ver=5.1.2:1 ot @ tos.js?ver=5.1.2:1 (anonymous) @ tos.js?ver=5.1.2:1 (anonymous) @ tos.js?ver=5.1.2:1 (anonymous) @ tos.js?ver=5.1.2:1
-
Sorry for the typo, “coming” from WooCommerce payments. Error is happening in the theme customizer. Never really noticed it before, so could be a new thing.
Hi @mcarter76
Thanks for reaching out!
Firstly, I apologize for the delayed response.
Can you please share with us a clear screenshot of what you see on your end so that we could address you more effectively?
If you don’t already have a screenshot service installed, you can try https://snipboard.io or http://skitch.com/. You can share the direct link to the image as a response to this topic.
Additionally, I’d like to understand your site properly, please share your System Status Report that you can find via
WooCommerce > Status
. SelectGet system report
and thenCopy for support
. Once you’ve done that, you can paste it into your reply here.If you could also provide the fatal error logs (if any) under
WooCommerce > Status > Logs
.Thanks!
It says file uploading is disabled, so I’m unable to attach a screen shot.
The URL this error occurs on is /wp-admin/customize.php if that helps at all.
There are no recent or related fatal errors in the Woocommerce status logs.
System Status Report
` ### WordPress Environment ### WordPress address (URL): https://www.mydomain.com Site address (URL): https://www.mydomain.com WC Version: 7.1.1 REST API Version: ✔ 7.1.1 WC Blocks Version: ✔ 8.7.6 Action Scheduler Version: ✔ 3.4.0 Log Directory Writable: ✔ WP Version: 6.1.1 WP Multisite: – WP Memory Limit: 256 MB WP Debug Mode: – WP Cron: – Language: en_US External object cache: ✔ ### Server Environment ### Server Info: Apache/2.4.54 () OpenSSL/1.0.2k-fips PHP Version: 8.1.13 PHP Post Max Size: 64 MB PHP Time Limit: 180 PHP Max Input Vars: 1000 cURL Version: 7.79.1 OpenSSL/1.0.2k-fips SUHOSIN Installed: – MySQL Version: 10.9.4-MariaDB Max Upload Size: 64 MB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔ ### Database ### WC Database Version: 7.1.1 WC Database Prefix: wp_ Total Database Size: 14.80MB Database Data Size: 12.47MB Database Index Size: 2.33MB wp_woocommerce_sessions: Data: 1.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_order_itemmeta: Data: 0.08MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_actions: Data: 0.14MB + Index: 0.13MB + Engine InnoDB wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_logs: Data: 0.09MB + Index: 0.03MB + Engine InnoDB wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_comments: Data: 0.06MB + Index: 0.09MB + Engine InnoDB wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_options: Data: 3.47MB + Index: 0.08MB + Engine InnoDB wp_postmeta: Data: 1.52MB + Index: 0.64MB + Engine InnoDB wp_posts: Data: 1.39MB + Index: 0.14MB + Engine InnoDB wp_termmeta: Data: 0.05MB + Index: 0.03MB + Engine InnoDB wp_terms: Data: 0.06MB + Index: 0.03MB + Engine InnoDB wp_term_relationships: Data: 0.05MB + Index: 0.02MB + Engine InnoDB wp_term_taxonomy: Data: 0.06MB + Index: 0.03MB + Engine InnoDB wp_usermeta: Data: 0.09MB + Index: 0.03MB + Engine InnoDB wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_admin_notes: Data: 0.05MB + Index: 0.00MB + Engine InnoDB wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_product_attributes_lookup: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_product_download_directories: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_product_meta_lookup: Data: 0.05MB + Index: 0.09MB + Engine InnoDB wp_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wpforms_entries: Data: 0.06MB + Index: 0.02MB + Engine InnoDB wp_wpforms_entry_fields: Data: 0.05MB + Index: 0.05MB + Engine InnoDB wp_wpforms_entry_meta: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_wpforms_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wpml_mails: Data: 3.52MB + Index: 0.00MB + Engine InnoDB ### Post Type Counts ### attachment: 337 custom_css: 2 customize_changeset: 2 jetpack-testimonial: 9 ml-slide: 7 ml-slider: 3 nav_menu_item: 10 page: 16 post: 7 product: 25 product_variation: 142 revision: 147 shop_coupon: 2 shop_order: 16 wp_global_styles: 2 wpforms: 2 ### Security ### Secure connection (HTTPS): ✔ Hide errors from visitors: ✔ ### Active Plugins (18) ### Classic Widgets: by WordPress Contributors – 0.3 Disable XML-RPC-API: by Neatma – 2.1.4.5 Flexible Shipping Import/Export Add-on: by Octolize – 1.4.0 Flexible Shipping: by Octolize – 4.17.0 Force SSL URL Scheme: by WebAware – 1.0.0 Free Shipping Kit: by Mike Carter – 1.0.6 GA Google Analytics: by Jeff Starr – 20221016 Jetpack: by Automattic – 11.6 Products Feed Generator: by Mike Carter – 1.0.5 SMTP Mailer: by naa986 – 1.1.5 VS Meta Description: by Guido – 6.8 Challan - PDF Invoice & Packing Slip for WooCommerce: by WebAppick – 3.4.7 WooCommerce Payments: by Automattic – 5.1.2 WooCommerce Shipping & Tax: by WooCommerce – 2.1.0 WooCommerce: by Automattic – 7.1.1 (update to version 7.2.0 is available) Super Page Cache for Cloudflare: by Optimole – 4.7.2 WP Mail Logging: by Wysija – 1.10.4 WPForms: by WPForms – 1.7.8 ### Inactive Plugins (0) ### ### Dropin Plugins (1) ### object-cache.php: Memcached ### Settings ### API Enabled: – Force SSL: – Currency: USD ($) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) subscription (subscription) variable (variable) variable subscription (variable-subscription) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5) Connected to WooCommerce.com: – Enforce Approved Product Download Directories: – ### WC Pages ### Shop base: #69 - /shop/ Cart: #70 - /cart/ Checkout: #71 - /checkout/ My account: #72 - /my-account/ Terms and conditions: #77 - /terms-and-conditions/ ### Theme ### Name: Kahoy Crafts Generate Press Theme Version: 1.0.0 Author URL: Child Theme: ✔ Parent Theme Name: GeneratePress Parent Theme Version: 3.2.4 Parent Theme Author URL: https://tomusborne.com WooCommerce Support: ✔ ### Templates ### Overrides: kahoycrafts-genpress/woocommerce/myaccount/form-login.php version 6.0.0 is out of date. The core version is 7.0.1 Outdated Templates: ❌ Learn how to update ### Subscriptions ### WCS_DEBUG: ✔ No Subscriptions Mode: ✔ Live Subscriptions Live URL: https://www.kahoycrafts.com Subscription Statuses: – WooCommerce Account Connected: ❌ No ### Store Setup ### Country / State: United States (US) — California ### Payment Gateway Support ### WooCommerce Payments: products refunds multiple_subscriptions subscription_cancellation subscription_payment_method_change_admin subscription_payment_method_change_customer subscription_payment_method_change subscription_reactivation subscription_suspension subscriptions gateway_scheduled_payments tokenization add_payment_method ### Admin ### Enabled Features: activity-panels analytics coupons customer-effort-score-tracks experimental-products-task experimental-import-products-task experimental-fashion-sample-products shipping-smart-defaults shipping-setting-tour homescreen marketing multichannel-marketing mobile-app-banner navigation onboarding onboarding-tasks remote-inbox-notifications remote-free-extensions payment-gateway-suggestions shipping-label-banner subscriptions store-alerts transient-notices woo-mobile-welcome wc-pay-promotion wc-pay-welcome-page Disabled Features: minified-js new-product-management-experience settings Daily Cron: ✔ Next scheduled: 2022-12-17 00:29:58 -08:00 Options: ✔ Notes: 25 Onboarding: completed ### WooCommerce Payments ### Version: 5.1.2 Connected to WPCOM: Yes Blog ID: 199301047 Account ID: acct_1Jq6uL2EiluwYXuX ### Action Scheduler ### Canceled: 2 Oldest: 2022-12-04 20:48:08 -0800 Newest: 2022-12-15 07:50:27 -0800 Complete: 254 Oldest: 2022-11-16 22:30:53 -0800 Newest: 2022-12-15 21:06:08 -0800 Failed: 11 Oldest: 2022-02-03 20:30:02 -0800 Newest: 2022-04-30 01:16:16 -0700 Pending: 6 Oldest: 2022-12-15 22:50:02 -0800 Newest: 2022-12-21 22:45:02 -0800 ### Status report information ### Generated at: 2022-12-15 21:14:19 -08:00 `
Tested this with the GeneratePress default theme, my own GeneratePress child theme, and the default WP 2023 them, the same error appears in all themes, so it doesn’t appear to be theme related.
Could be a plugin conflict, but not sure.
Here is a fix I made to my theme’s function.php file. Hopefully, it will help anyone else who is experiencing this issue. It seems that a lot of plugins load all JS and CSS files on pages that aren’t relevant and occasionally this can lead to conflicts. It’s very inefficient too.
add_action( 'admin_enqueue_scripts', 'mytheme_admin_styles', 11, 1 ); function mytheme_admin_styles( $hook ) { wp_dequeue_style( 'jetpack-jitm' ); wp_dequeue_style( 'jetpack-plugins-page-js' ); wp_deregister_script( 'jetpack-jitm' ); wp_deregister_script( 'jetpack-plugins-page-js' ); // Fix error with woo-pay tos.js if ($_SERVER['PHP_SELF'] == '/wp-admin/customize.php') { wp_dequeue_style('wcpay-admin-css'); wp_dequeue_style('WCPAY_TOS'); wp_dequeue_style('wc-blocks-checkout-style'); wp_deregister_script( 'WCPAY_TOS' ); wp_deregister_script( 'WCPAY_MULTI_CURRENCY_ANALYTICS' ); } }
Hi @mcarter76 glad you were able to find the solution, if you have any new questions, please open a new ticket.
Cheers!
- The topic ‘Error message in tos.js’ is closed to new replies.