• Resolved mnydigital

    (@mnydigital)


    I’m experiencing a number of console errors with a new WooCommerce site I’m working on.

    The errors seem to stem from WooCommerce directly, the most common of which is an error in wc-blocks-middleware.js.

    I’m seeing a slightly different message in different browsers, but they seem the same. In Safari, I’m getting:

    Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'e.Nonce')
    (anonymous function) — wc-blocks-middleware.js:1:1768
    ye — wc-blocks-data.js:1:20448
    (anonymous function) — wc-blocks-data.js:1:21459
    promiseReactionJob

    In Firefox, I’m getting (numerous times on each page load):

    Uncaught (in promise) TypeError: e is undefined wc-blocks-middleware.js:1:1753
    setNonce https://localhost:8888/mysite/wp-content/plugins/woocommerce/packages/woocommerce-blocks/build/wc-blocks-middleware.js?ver=397e7b9fdac5b97dab48de9dbcd81edd:1
    ye https://localhost:8888/mysite/wp-content/plugins/woocommerce/packages/woocommerce-blocks/build/wc-blocks-data.js?ver=892ed73ca32d3b4ec7c07493651ca9a1:1
    be https://localhost:8888/mysite/wp-content/plugins/woocommerce/packages/woocommerce-blocks/build/wc-blocks-data.js?ver=892ed73ca32d3b4ec7c07493651ca9a1:1
    promise callback170/be/< https://localhost:8888/mysite/wp-content/plugins/woocommerce/packages/woocommerce-blocks/build/wc-blocks-data.js?ver=892ed73ca32d3b4ec7c07493651ca9a1:1 be https://localhost:8888/mysite/wp-content/plugins/woocommerce/packages/woocommerce-blocks/build/wc-blocks-data.js?ver=892ed73ca32d3b4ec7c07493651ca9a1:1 API_FETCH_WITH_HEADERS https://localhost:8888/mysite/wp-content/plugins/woocommerce/packages/woocommerce-blocks/build/wc-blocks-data.js?ver=892ed73ca32d3b4ec7c07493651ca9a1:1 Redux 13 C https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2 k https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2 ie https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2 a https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2 setTimeout handlera https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    i https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    d https://localhost:8888/mysite/wp-content/plugins/woocommerce/packages/woocommerce-blocks/build/price-filter-wrapper-frontend.js?ver=859c7696992bdd22d9c0:1
    d https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:9
    l https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    g https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    d https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:9
    Ke https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:9
    a https://localhost:8888/mysite/wp-content/plugins/woocommerce/packages/woocommerce-blocks/build/price-filter-wrapper-frontend.js?ver=859c7696992bdd22d9c0:1
    b https://localhost:8888/mysite/wp-content/plugins/woocommerce/packages/woocommerce-blocks/build/price-filter-wrapper-frontend.js?ver=859c7696992bdd22d9c0:1
    a https://localhost:8888/mysite/wp-content/plugins/woocommerce/packages/woocommerce-blocks/build/attribute-filter-wrapper-frontend.js?ver=5b3155f855d33b652639:1
    ct https://localhost:8888/mysite/wp-includes/js/dist/vendor/react-dom.min.js?ver=17.0.1:9
    Bt https://localhost:8888/mysite/wp-includes/js/dist/vendor/react-dom.min.js?ver=17.0.1:9
    os https://localhost:8888/mysite/wp-includes/js/dist/vendor/react-dom.min.js?ver=17.0.1:9
    Ur https://localhost:8888/mysite/wp-includes/js/dist/vendor/react-dom.min.js?ver=17.0.1:9
    Ir https://localhost:8888/mysite/wp-includes/js/dist/vendor/react-dom.min.js?ver=17.0.1:9

    Sometimes I’ll see this error in Firefox instead:

    Uncaught (in promise) Error: There is no route for the given namespace (/wc/store/v1) in the store wc-blocks-data.js:1:16690
    w https://localhost:8888/mysite/wp-content/plugins/woocommerce/packages/woocommerce-blocks/build/wc-blocks-data.js?ver=892ed73ca32d3b4ec7c07493651ca9a1:1
    t https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    p https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    r https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    i https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    a https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    f https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    p https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    x https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    i Redux
    C https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    k https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    a https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    a https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    i https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    a https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    d https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    d https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    P https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    Redux 9
    C https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    k https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    ie https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    a https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    setTimeout handler*a https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    i https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    a https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    d https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    d https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    P https://localhost:8888/mysite/wp-includes/js/dist/data.min.js?ver=d8cf5b24f99c64ae47d6:2
    Redux 3

    I’ve disabled every plugin bar WooCommerce, which is up to date (version 7.5.1), and reverted to the Storefront theme, with no customisation at all. WordPress is up to date, as are my browsers.

    I’m at a bit of a loss as to why the errors are appearing. Sometimes they don’t appear, but most of the time they do. The filters seem to take a long time to load also.

    For the most part, the store seems to work okay, but there’s the occasional hiccup, and the messages don’t fill me with confidence.

    I stripped the widgets back to just the price filter and that is enough to cause an error. I tried removing all my products, in case there was a weird attribute throwing things out, but the error happens even with no products.

    I get the errors even in the Twenty Twenty One theme.

    Removing all sidebar widgets causes the errors to stop.

    WordPress Environment
    
    WordPress address (URL): https://localhost:8888/mysite
    Site address (URL): https://localhost:8888/mysite
    WC Version: 7.5.1
    REST API Version: ? 7.5.1
    WC Blocks Version: ? 9.6.6
    Action Scheduler Version: ? 3.5.4
    Log Directory Writable: ?
    WP Version: 6.2
    WP Multisite: –
    WP Memory Limit: 256 MB
    WP Debug Mode: –
    WP Cron: ?
    Language: en_GB
    External object cache: – Server Environment Server Info: Apache/2.4.46 (Unix) OpenSSL/1.0.2u PHP/7.4.12 mod_wsgi/3.5 Python/2.7.13 mod_fastcgi/mod_fastcgi-SNAP-0910052141 mod_perl/2.0.11 Perl/v5.30.1
    PHP Version: 7.4.12
    PHP Post Max Size: 8 MB
    PHP Time Limit: 30
    PHP Max Input Vars: 1000
    cURL Version: 7.68.0
    OpenSSL/1.0.2u SUHOSIN Installed: –
    MySQL Version: 5.7.32
    Max Upload Size: 8 MB
    Default Timezone is UTC: ?
    fsockopen/cURL: ?
    SoapClient: ?
    DOMDocument: ?
    GZip: ?
    Multibyte String: ?
    Remote Post: ?
    Remote Get: ? Database WC Database Version: 7.5.1
    WC Database Prefix: wp_
    Total Database Size: 14.93MB
    Database Data Size: 11.26MB
    Database Index Size: 3.67MB
    wp_woocommerce_sessions: Data: 0.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.02MB + 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: 1.52MB + Index: 0.66MB + 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.41MB + Index: 0.31MB + Engine InnoDB
    wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_comments: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
    wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_options: Data: 4.02MB + Index: 0.06MB + Engine InnoDB
    wp_postmeta: Data: 1.52MB + Index: 0.86MB + Engine InnoDB
    wp_posts: Data: 0.31MB + Index: 0.09MB + Engine InnoDB
    wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_term_relationships: Data: 1.09MB + Index: 0.19MB + Engine InnoDB
    wp_term_taxonomy: Data: 0.05MB + Index: 0.03MB + Engine InnoDB
    wp_usermeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
    wp_wc_admin_notes: Data: 0.02MB + 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: 1.52MB + Index: 0.36MB + Engine InnoDB
    wp_wc_product_download_directories: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_wc_product_meta_lookup: Data: 0.06MB + 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_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB Post Type Counts attachment: 2
    customize_changeset: 11
    page: 7
    post: 2
    product: 348
    revision: 5
    wpforms: 1 Security Secure connection (HTTPS): ?
    Your store is not using HTTPS. Learn more about HTTPS and SSL Certificates.
    Hide errors from visitors: ? Active Plugins (1) WooCommerce: by Automattic – 7.5.1 Inactive Plugins (4) Jetpack: by Automattic – 11.9.1
    WooCommerce Payments: by Automattic – 5.6.2
    WooCommerce Shipping & Tax: by WooCommerce – 2.2.4
    WPForms Lite: by WPForms – 1.8.0.2 Settings API Enabled: –
    Force SSL: –
    Currency: GBP (£)
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 2
    Taxonomies: Product Types: external (external)
    grouped (grouped)
    simple (simple)
    variable (variable) 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: ?
    Order datastore: WC_Order_Data_Store_CPT WC Pages Shop base: #6 - /
    Basket: #7 - /basket/
    Checkout: #8 - /checkout/
    My account: #9 - /my-account/
    Terms and conditions: ? Page not set Theme Name: Storefront
    Version: 4.2.0
    Author URL: https://woocommerce.com/
    Child Theme: ? – If you are modifying WooCommerce on a parent theme that you did not build
    personally we recommend using a child theme. See: How to create a child theme WooCommerce Support: ? Templates Overrides: – Admin Enabled Features: activity-panels
    analytics
    coupons
    customer-effort-score-tracks
    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
    product-variation-management
    settings Daily Cron: ? Next scheduled: 2023-03-30 14:11:06 +01:00
    Options: ?
    Notes: 46
    Onboarding: completed Action Scheduler Complete: 1,865
    Oldest: 2023-03-13 14:12:20 +0000
    Newest: 2023-03-30 13:22:28 +0100 Failed: 4
    Oldest: 2023-03-13 15:57:15 +0000
    Newest: 2023-03-28 11:58:43 +0100 Pending: 1
    Oldest: 2023-03-31 13:21:50 +0100
    Newest: 2023-03-31 13:21:50 +0100 Status report information Generated at: 2023-03-30 13:35:17 +01:00
Viewing 11 replies - 1 through 11 (of 11 total)
  • Hello,

    I understand you are receiving console errors on different browsers.

    Can you please share a copy of any fatal error log found under WooCommerce > System Status > Logs (if available)?

    May I have a link to the page (Or staging site page) where the errors are being generated?

    Looking forward to hearing from you.

    Thread Starter mnydigital

    (@mnydigital)

    Hello, thanks for the reply.

    I checked the logs and the only critical errors were minor development typos which I quickly fixed when they occurred.

    I am using localhost at the moment whilst I’m still working on the site, so I don’t have a live link that I can share.

    I have noticed that another store running the same version of WooCommerce and WordPress doesn’t exhibit the same errors, for reasons unknown. That site doesn’t include wc-blocks-middleware.js for some reason though, whereas the site that’s producing the errors does, and that’s the main file where the issues seem to stem from…

    Saif

    (@babylon1999)

    Hello @mnydigital,

    Can you please share a screenshot and names of the sidebar widgets you’re using so we can try replicating the issue? ??

    You can share screenshots with Snipboard or Imgur.

    Look forward to hearing back from you.

    Thread Starter mnydigital

    (@mnydigital)

    It’s just the standard price slider widget.

    Saif

    (@babylon1999)

    I can’t see the mentioned error on my test site when activating the widget.


    Link to image: https://d.pr/i/zOBU5x

    Since the problem is not present on your other test site as well, this is most likely not a bug.

    I suspect there is a corrupted file in your WooCommerce installation. Have you tried reinstalling WooCommerce?

    Look forward to hearing back from you.

    Thread Starter mnydigital

    (@mnydigital)

    I’ve just reinstalled WooCommerce and the problem remains.

    Even though it’s not presenting itself for you, it’s still possible that it’s a bug; it might just be my particular setup or store data and how that interacts with WooCommerce.

    The problem also doesn’t occur on every page load; sometimes it takes a few times before it does.

    Can I ask what the purpose of wc-blocks-middleware.js is and why one site would include it and another site not?

    Saif

    (@babylon1999)

    Even though it’s not presenting itself for you, it’s still possible that it’s a bug; it might just be my particular setup or store data and how that interacts with WooCommerce.

    That is possible indeed, but judging from the conversation you had with the developers, the problem doesn’t seem related to WooCommerce, at least for now.

    I suggest you try re-installing the server as mentioned here.

    Can I ask what the purpose of wc-blocks-middleware.js is and why one site would include it and another site not?

    I am not a developer, so I cannot say for sure. However, checking the template, I can see it’s checking for something and then adding a nonce. If I had to guess, it is likely some sort of security feature, but I could be wrong. ??

    Cheers!

    Thread Starter mnydigital

    (@mnydigital)

    Thanks for the reply. I appreciate the difficulty of diagnosing the problem. I didn’t want to confuse matters by opening issues in two places but just thought I’d cover all bases as I’ve exhausted my ideas.

    Interestingly, in that thread they suggested installing woocommerce-gutenberg-products-block, and I have had no errors so far, which is sort of good, but still leaves the exact cause unresolved. Providing the errors don’t start appearing again, that suggests the problem lies in how woocommerce-blocks and my site are interacting. Though as I’ve said earlier, everything has been completely stripped back and there’s very little customisation, so I would lean towards the product data/attributes being the issue on my side, if there is one. Why, though, I don’t know.

    Thanks.

    • This reply was modified 1 year, 7 months ago by mnydigital.
    • This reply was modified 1 year, 7 months ago by mnydigital.

    Hi,

    There are new versions of WooCommerce (7.6.0) and WooCommerce Blocks (10.0.0) rolled out, can you please try again after updating them to see if that helps to solve the issue?

    If touching the live site is not an option you can set up a staging site, if your host doesn’t offer that option, we recommend WP Staging for quickly spinning up a new test site. So that you can test without risks.

    Let us know how that goes for you.

    Thread Starter mnydigital

    (@mnydigital)

    Unfortunately none of the updates have made a difference; the errors are still there.

    I am probably going to have to set up a new store and gradually make changes to see what it is that triggers this.

    Update: I created a brand new store with a new database table. Installed WordPress, WooCommerce and Storefront. The only thing I did was add a price filter to the sidebar and I got the error immediately in Firefox. I hadn’t even added products yet. This looks like something beyond my control in that case.

    • This reply was modified 1 year, 7 months ago by mnydigital.

    Hi @mnydigital

    It seems like you’re discussing the same issue in woocommerce-blocks repo here: (https://github.com/woocommerce/woocommerce-blocks/issues/8910)

    The developers still can’t replicate the issue on their end, please try their last suggestions and let us know how that goes.

    Let us know how that goes!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Various console errors caused by sidebar widgets’ is closed to new replies.